Skip to content

Move gizmo arrows drag an imported STEP component (#3203) - #3228

Closed
phanoob wants to merge 3 commits into
tangency-labs:mainfrom
phanoob:step-move-gizmo
Closed

phanoob wants to merge 3 commits into
tangency-labs:mainfrom
phanoob:step-move-gizmo

Conversation

@phanoob

@phanoob phanoob commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #3203.

Problem

Move/Copy from a component's right-click menu opens the Move: window and draws a move triad. An inserted STEP file is such a component. Its arrows never lit up, and dragging them did nothing: the drag went to the view. Typed distances worked.

The cause: that triad was painted on an egui layer of its own (LayerId::new(Order::Middle, …) with no area behind it). egui only looks among its areas for the layer under the pointer, so for that layer the answer was always "not this one". gizmo::show saw no pointer over its rectangle, found no handle hovered, and never started a drag.

This was not specific to STEP. Native geometry most likely worked for the reporter because it went through the Move window (M on bodies), whose triad the viewport draws.

Fix

  • The occurrence triad is now drawn by the viewport, in canvas::show, next to the Move window's triad: browser::occurrence_move_triad.
  • canvas::owns_pointer now includes the occurrence triad, so navigation leaves a press on its handles to the triad.
  • The occurrence window keeps its fields. A drag updates them and moves the occurrence, which runs occurrence.move only when a value changed.
  • Like the Move window's triad, it now draws under floating windows instead of over them.
Before: dragging the X arrow 120 px After
before after

Steps: make a box and a cylinder, file.export to a STEP file, start a new design, file.insert_step it, right-click the component, choose Move/Copy, then drag the red arrow.

Tests

  • browser::occurrence_ui_tests::dragging_the_occurrence_triad_moves_the_occurrence (harness): opens Move/Copy on an occurrence and drags its X arrow. The test checks three things:

    • X distance grows and Y and Z stay at 0;
    • the bodies' world bounds follow by that amount;
    • the camera does not move.

    It fails on main with a translation of [0, 0, 0].

  • cargo clippy -p solidcraft-ui-egui --all-targets -D warnings is clean.

  • The browser, occurrence, canvas, Move dialog, gizmo, navigation and viewport tests pass, except expression_complete::…modified_navigation… and viewport::…visible_gaps. Those two also fail on main on this Windows machine.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
phanoob and others added 2 commits October 19, 2026 22:13
Move/Copy on a component drew its triad on a painter layer of its own.
egui only finds the layer under the pointer among its areas, so that
layer was never under it: the arrows never lit up and a drag went to the
view instead. The triad is now drawn by the viewport with the Move
window's, and the viewport leaves a press on it to the triad.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@phanoob
phanoob marked this pull request as ready for review October 19, 2026 20:22
@phanoob

phanoob commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Closing: #3015 (merged for #3014) fixed the same thing on main, drawing the occurrence triad in the viewport. This PR's harness test (dragging the X arrow of Move/Copy on an occurrence moves it, not the camera) passes against main's code as it is, so #3203 should be fixed by #3015 too.

🤖 Generated with Claude Code

@phanoob phanoob closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modeling: unexpected result

1 participant