Fix Eyedropper tool and make Svelte's bind:this more robust

This commit is contained in:
Keavon Chambers
2023-03-11 12:32:01 -08:00
parent 919779130f
commit 29af355f20
23 changed files with 177 additions and 142 deletions

View File

@@ -925,7 +925,7 @@ impl Fsm for SelectToolFsmState {
HintInfo::keys([Key::Control], "Opp. Corner").prepend_plus(),
]),
HintGroup(vec![
HintInfo::keys([Key::Alt], "Move Duplicate"),
HintInfo::keys_and_mouse([Key::Alt], MouseMotion::LmbDrag, "Move Duplicate"),
HintInfo::keys([Key::Control, Key::KeyD], "Duplicate").add_mac_keys([Key::Command, Key::KeyD]),
]),
]);

View File

@@ -539,6 +539,17 @@ impl HintInfo {
}
}
pub fn keys_and_mouse(keys: impl IntoIterator<Item = Key>, mouse_motion: MouseMotion, label: impl Into<String>) -> Self {
let keys: Vec<_> = keys.into_iter().collect();
Self {
key_groups: vec![KeysGroup(keys).into()],
key_groups_mac: None,
mouse: Some(mouse_motion),
label: label.into(),
plus: false,
}
}
pub fn arrow_keys(label: impl Into<String>) -> Self {
HintInfo {
key_groups: vec![