Merge pull request #1792 from gianlucafiore/fix/otrack-live-distance-click-precision

Improve precise picking, OSNAP/OTRACK feedback and selection cursor
This commit is contained in:
gianlucafiore authored and GitHub committed 2026-10-14 11:33:07 -03:00
commit 8e7612c0c9
7 files changed
+138 -9

No files matched your search

+19 -1
View File
@@ -50,7 +50,7 @@ fn is_modal_blocked_key_msg(msg: &Message) -> bool {
fn perf_message_label(msg: &Message) -> &'static str {
match msg {
Message::ViewportLeftPress | Message::PanePress(_) => "pointer-down",
Message::ViewportLeftPressAt(_) | Message::ViewportLeftPress | Message::PanePress(_) => "pointer-down",
Message::ViewportLeftRelease | Message::PaneRelease(_) => "pointer-up",
Message::ViewportMove(_) | Message::PaneMove(_, _) => "pointer-move",
Message::CommandFinalize => "command-finalize",
@@ -4404,6 +4404,7 @@ impl OpenCADStudio {
// A multi-finger gesture owns the pointer while it runs.
Message::ViewportMove(_)
| Message::ViewportLeftPressAt(_)
| Message::ViewportLeftPress
| Message::ViewportLeftRelease
| Message::PaneMove(..)
@@ -4488,6 +4489,17 @@ impl OpenCADStudio {
self.update(Message::ViewportScroll(d))
}
Message::ViewportLeftPressAt(position) => {
// Use the pointer location captured by the actual button
// event. The last hover can lag behind fast cursor motion,
// particularly while expensive OSNAP/OTRACK previews run.
// Refresh the snap and world point before accepting the pick.
let moved = self.on_viewport_move(position);
self.graphic_attributes.open_menu = None;
let sweep = self.sync_active_field_if_any();
Task::batch(vec![moved, sweep, self.on_viewport_left_press()])
}
Message::ViewportLeftPress => {
self.graphic_attributes.open_menu = None;
let sweep = self.sync_active_field_if_any();
@@ -6339,6 +6351,12 @@ impl OpenCADStudio {
}
Task::none()
}
Message::DraftingSettingsOsnapApertureChanged(value) => {
if let Some(state) = &mut self.drafting_settings_state {
state.osnap_aperture_input = value;
}
Task::none()
}
Message::DraftingSettingsToggleOsnap => {
if let Some(state) = &mut self.drafting_settings_state {
state.osnap_on = !state.osnap_on;