forked from 1b-agent/opencadstudio-upstream
Show active tracking reference tooltip
This commit is contained in:
1 parent
f1bc5f2cae
commit
a06e8a7a69
7 files changed
+144
-1
No files matched your search
@@ -87,6 +87,7 @@ impl OpenCADStudio {
|
||||
self.snapper.from_point = None;
|
||||
self.snapper.clear_tracking();
|
||||
self.otrack_active = None;
|
||||
self.otrack_kind = None;
|
||||
self.axis_lock_dir = None;
|
||||
self.dyn_user_reshaped = false;
|
||||
self.dyn_coord_absolute = false;
|
||||
|
||||
@@ -430,6 +430,9 @@ pub(super) struct OpenCADStudio {
|
||||
/// cursor is on a tracking ray. Lets a typed distance place a point along
|
||||
/// the ray from the tracking point (issue #69). `None` when not aligned.
|
||||
otrack_active: Option<(glam::DVec3, glam::DVec3)>,
|
||||
/// Kind of the currently active tracking reference, kept separately from
|
||||
/// `otrack_active` so typed-distance behavior remains unchanged.
|
||||
otrack_kind: Option<crate::snap::TrackingKind>,
|
||||
/// Whether Tangent snap was enabled before a tangent-pick command started.
|
||||
pre_cmd_tangent: Option<bool>,
|
||||
/// Drawing defaults captured by ADDSELECTED before it adopts the template
|
||||
@@ -3052,6 +3055,7 @@ impl OpenCADStudio {
|
||||
annotation_auto_scale: -4,
|
||||
last_saved_config: None,
|
||||
otrack_active: None,
|
||||
otrack_kind: None,
|
||||
clean_screen: false,
|
||||
quick_properties: false,
|
||||
quick_properties_anchor: Point::new(12.0, 12.0),
|
||||
|
||||
@@ -255,6 +255,7 @@ impl OpenCADStudio {
|
||||
{
|
||||
self.snapper.clear_tracking();
|
||||
self.otrack_active = None;
|
||||
self.otrack_kind = None;
|
||||
}
|
||||
if let Some(started) = perf_started {
|
||||
let elapsed_ms = started.elapsed().as_secs_f64() * 1000.0;
|
||||
@@ -280,6 +281,7 @@ impl OpenCADStudio {
|
||||
pub(in crate::app) fn reset_tracking_after_point(&mut self) {
|
||||
self.snapper.clear_tracking();
|
||||
self.otrack_active = None;
|
||||
self.otrack_kind = None;
|
||||
}
|
||||
|
||||
fn update_inner(&mut self, msg: Message) -> Task<Message> {
|
||||
|
||||
@@ -1083,6 +1083,7 @@ impl OpenCADStudio {
|
||||
};
|
||||
|
||||
self.otrack_active = otrack_hit.map(|hit| (hit.base, hit.dir));
|
||||
self.otrack_kind = otrack_hit.map(|hit| hit.kind);
|
||||
|
||||
let mut snapped = if let Some(hit) = otrack_hit {
|
||||
hit.aligned
|
||||
@@ -1519,6 +1520,7 @@ impl OpenCADStudio {
|
||||
}
|
||||
};
|
||||
self.otrack_active = otrack_hit.map(|h| (h.base, h.dir));
|
||||
self.otrack_kind = otrack_hit.map(|h| h.kind);
|
||||
|
||||
// Parallel snap: with nothing else snapped or tracked, lock
|
||||
// the point onto the line through last_point parallel to the
|
||||
|
||||
@@ -809,6 +809,17 @@ impl OpenCADStudio {
|
||||
.as_ref()
|
||||
.map(|c| c.prompt())
|
||||
.unwrap_or_default();
|
||||
|
||||
let tracking_hint = match self.otrack_kind {
|
||||
Some(crate::snap::TrackingKind::Perpendicular) => {
|
||||
Some("Perpendicular".to_string())
|
||||
}
|
||||
Some(crate::snap::TrackingKind::Extension) => {
|
||||
Some("Extension".to_string())
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
|
||||
Some(crate::ui::overlay::dynamic_input_overlay(
|
||||
tab.last_cursor_screen,
|
||||
tab.last_point_screen,
|
||||
@@ -816,6 +827,7 @@ impl OpenCADStudio {
|
||||
tab.dyn_guide,
|
||||
boxes,
|
||||
prompt,
|
||||
tracking_hint,
|
||||
))
|
||||
} else {
|
||||
None
|
||||
|
||||
Reference in new issue
Block a user