mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-11 16:33:22 -06:00
Type tool: Alt-click on a closed path makes area type too; type along a closed path stays with Type on a Path
This commit is contained in:
@@ -55,7 +55,6 @@ impl Tool for TypeTool {
|
||||
}
|
||||
self.press = Some((ev.pos, self.snap.press(cx, ev.pos, self.editing.as_slice(), None)));
|
||||
self.held = Some(self.acting(ev.mods));
|
||||
self.held_alt = ev.mods.alt && self.editing.is_none();
|
||||
self.drag = None;
|
||||
vec![]
|
||||
}
|
||||
@@ -633,12 +632,12 @@ impl Tool for TypeTool {
|
||||
/// The pointer of the Type tool that a press would act as with the keys held, or, while a
|
||||
/// press is held, of the one it acts as ([`TypeTool::acting`]).
|
||||
fn cursor(&self, cx: &ToolContext, p: Point, m: Mods) -> Cursor {
|
||||
let ((mode, vertical), alt) = match (self.press, self.held) {
|
||||
(Some(_), Some(held)) => (held, self.held_alt),
|
||||
_ => (self.acting(m), m.alt && self.editing.is_none()),
|
||||
let (mode, vertical) = match (self.press, self.held) {
|
||||
(Some(_), Some(held)) => held,
|
||||
_ => self.acting(m),
|
||||
};
|
||||
// While type is being edited a click on a path only ends the editing.
|
||||
let in_path = if self.editing.is_some() { None } else { Self::in_path(cx, p, mode, alt) };
|
||||
let in_path = if self.editing.is_some() { None } else { Self::in_path(cx, p, mode) };
|
||||
match (in_path, vertical) {
|
||||
(Some((_, false)), false) => Cursor::TypeArea,
|
||||
(Some((_, false)), true) => Cursor::TypeAreaVertical,
|
||||
|
||||
Reference in New Issue
Block a user