feat(grips): the crosshair locks onto a hovered grip

Before a grip is picked, the crosshair now jumps to the grip under it, so
the click lands where the marker shows.

Discussion #1557

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-07 08:50:11 +03:00
1 parent 7f59d8f679
commit 1c37c90c75
1 file changed
+4 -1
+4 -1
View File
@@ -1898,7 +1898,10 @@ impl canvas::Program<Message> for SelectionCanvas {
&& !self.suppressed
&& self.crosshair.cursor_type == CursorType::Crosshair
{
if let Some(cp) = self.selection.borrow().input.last_move_pos {
// Over a grip the crosshair locks onto it, so the click lands on
// the grip exactly.
let hovered_grip = self.grips.iter().find(|grip| grip.is_hovered).map(|grip| grip.pos);
if let Some(cp) = hovered_grip.or(self.selection.borrow().input.last_move_pos) {
let [r, g, b, a] = self.crosshair.color.map_or_else(
|| {
crate::scene::view::render::adapt_to_bg(