mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-01 21:57:12 -06:00
Cursors: Caps Lock gives the drawing tools the crosshair
While Caps Lock is on, the tools whose pointer General > Use Precise Cursors changes show the crosshair, and the saved preference does not change. The desktop app reads the lock state on macOS, Windows and Linux X11 and passes each change to the new view.capsLock command. A change to view.capsLock or usePreciseCursors through app.run refreshes the canvas pointer. The view.preciseCursors command is labeled Use Precise Cursors, so command search finds it by the preference's name.
This commit is contained in:
@@ -604,8 +604,8 @@ impl Session {
|
||||
v
|
||||
}
|
||||
|
||||
/// The pointer the active tool shows at `p` (General › Use Precise Cursors makes the drawing
|
||||
/// tools' a crosshair, [`Cursor::precise`]). With Cmd held, the pointer of the selection tool a
|
||||
/// The pointer the active tool shows at `p` (General › Use Precise Cursors, or Caps Lock while
|
||||
/// it is on, makes the drawing tools' a crosshair, [`Cursor::precise`]). With Cmd held, the pointer of the selection tool a
|
||||
/// press would borrow ([`Self::lend_selection_tool`]).
|
||||
pub fn cursor(&mut self, p: Point, mods: Mods, view: ViewInfo) -> Cursor {
|
||||
let lent = if mods.cmd && self.lender.is_none() { self.lent_tool(self.tool.id(), &mods) } else { None };
|
||||
@@ -619,7 +619,7 @@ impl Session {
|
||||
}
|
||||
None => self.with_tool_cx(view, |t, cx| t.cursor(cx, p, mods)),
|
||||
};
|
||||
if self.prefs.use_precise_cursors { c.precise() } else { c }
|
||||
if self.prefs.use_precise_cursors || self.caps_lock { c.precise() } else { c }
|
||||
}
|
||||
|
||||
pub fn tool_options(&self) -> Value {
|
||||
|
||||
Reference in New Issue
Block a user