mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-10 09:59:47 -06:00
Fix #2898: Up and Down change the corner kind while dragging a widget
Squashed from #5090 onto main.
This commit is contained in:
@@ -617,6 +617,10 @@ impl Tool for SelectionTool {
|
||||
/// is left, and the tool waits for the next press. With the pointer loaded with text, Escape
|
||||
/// drops the text.
|
||||
fn key(&mut self, _cx: &ToolContext, key: ToolKey, _mods: Mods) -> Vec<Action> {
|
||||
// Up and Down while a corner widget is pressed: the corners' kind (#2898).
|
||||
if let (ToolKey::Up | ToolKey::Down, State::Corner(c)) = (key, &mut self.state) {
|
||||
return c.step_kind(key == ToolKey::Up);
|
||||
}
|
||||
if key == ToolKey::Letter('e')
|
||||
&& let State::Marquee { enclosed, .. } = &mut self.state
|
||||
{
|
||||
@@ -652,6 +656,7 @@ impl Tool for SelectionTool {
|
||||
fn claims_key(&self, _cx: &ToolContext, key: ToolKey) -> bool {
|
||||
match self.state {
|
||||
State::Marquee { .. } => key == ToolKey::Letter('e'),
|
||||
State::Corner(_) => matches!(key, ToolKey::Up | ToolKey::Down),
|
||||
State::Loaded { .. } | State::Mirror(_) | State::GridRepeat(_) => key == ToolKey::Escape,
|
||||
_ => false,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user