fix(grip): open hover popup without requiring mouse motion

Dwell timing only advanced when `ViewportMove` fired; a perfectly
still cursor never triggered the popup. Subscribe to animation
frames while `grip_hover` is set and dispatch `GripDwellTick` from
them so `update_grip_hover` re-checks the elapsed dwell each frame.
Subscription auto-stops as soon as the hover clears or the popup
opens.
This commit is contained in:
Hakan Seven 2026-05-29 09:38:37 +03:00
commit 595ee3e245
3 changed files with 29 additions and 0 deletions

View file

@ -3067,6 +3067,21 @@ impl OpenCADStudio {
Task::none()
}
Message::GripDwellTick => {
let i = self.active_tab;
// Reuse the move-time logic — `p` is the last cursor
// position the viewport saw, which is also what the
// hover state was last set with.
let p = self.tabs[i]
.scene
.selection
.borrow()
.last_move_pos
.unwrap_or(self.cursor_pos);
self.update_grip_hover(i, p);
Task::none()
}
Message::GripMenuPick(idx) => {
let i = self.active_tab;
let Some(popup) = self.grip_popup.take() else {