* claim: #5137 * Dragging a part along its joint no longer highlights what's under the pointer (#5137) The viewport's hover pick was skipped during a box selection and camera moves, but not while a jointed part was dragged, so faces and edges under the pointer lit up on every frame of the drag. The pick now waits until the joint drag ends.
This commit is contained in:
@@ -187,6 +187,24 @@ mod tests {
|
||||
assert!(arm_at(&h, end).dist(end) < 1e-9, "{:?}", arm_at(&h, end));
|
||||
}
|
||||
|
||||
/// #5137: while a part is dragged along its joint, nothing under the pointer highlights; hover
|
||||
/// comes back once the drag ends.
|
||||
#[test]
|
||||
fn dragging_a_jointed_part_highlights_nothing_under_the_pointer() {
|
||||
let (mut h, _, a, b) = hinged_arm();
|
||||
h.app.synthetic.push(egui::Event::PointerMoved(a));
|
||||
play(&mut h);
|
||||
assert!(h.app.viewport.hover.is_some(), "the arm under the pointer must highlight before the drag");
|
||||
press_and_move(&mut h, a, b);
|
||||
assert!(h.app.viewport.joint_drag.is_some(), "the drag must move the arm");
|
||||
assert!(h.app.viewport.hover.is_none(), "dragging a part must not highlight what is under the pointer");
|
||||
h.frames(2);
|
||||
assert!(h.app.viewport.hover.is_none(), "a drag held still must not highlight either");
|
||||
release(&mut h, b);
|
||||
h.frames(2);
|
||||
assert!(h.app.viewport.hover.is_some(), "hover must return after the drag");
|
||||
}
|
||||
|
||||
/// With the undo history full, a drag still adds one step: it drops the oldest once, not one
|
||||
/// per frame.
|
||||
#[test]
|
||||
|
||||
@@ -2874,7 +2874,11 @@ pub fn show(app: &mut SolveApp, ui: &mut egui::Ui) {
|
||||
|| app.viewport.axis_drag.is_some()
|
||||
|| app.viewport.spin
|
||||
|| app.cam_anim.is_some();
|
||||
let hits = hover.filter(|_| inside && app.viewport.boxsel.is_none() && !navigating).map(|p| pick_cached(app, &proj, p)).unwrap_or_default();
|
||||
// A part dragged along its joint owns the pointer: nothing under it lights up (#5137).
|
||||
let hits = hover
|
||||
.filter(|_| inside && app.viewport.boxsel.is_none() && !crate::joint_drag::active(app) && !navigating)
|
||||
.map(|p| pick_cached(app, &proj, p))
|
||||
.unwrap_or_default();
|
||||
// The Fillet and Chamfer window resolves its own corners: the nearest sketch point to a
|
||||
// corner drawn from the origin is the fixed origin, which ends no two curves.
|
||||
let corner = hover.filter(|_| inside && !navigating).and_then(|p| crate::sketch_modify_ui::corner_hit(app, &proj, p));
|
||||
|
||||
Reference in New Issue
Block a user