fix(assembly): update flip-detection baseline during drag steps
Some checks failed
Build and Test / build (pull_request) Has been cancelled

During drag operations, validateNewPlacements() compared each solver
result against the pre-drag positions saved once in preDrag().  As the
user dragged further, the cumulative rotation from that fixed baseline
easily exceeded the 91-degree threshold, causing valid intermediate
results to be rejected with 'flipped orientation' warnings and making
parts appear to explode.

Fix: call savePlacementsForUndo() after each accepted drag step so
that the flip check compares against the last accepted state rather
than the original pre-drag origin.
This commit is contained in:
forbes
2026-02-21 09:59:04 -06:00
parent 0f8fa0be86
commit 5d55f091d0

View File

@@ -509,6 +509,14 @@ void AssemblyObject::doDragStep()
if (validateNewPlacements()) {
setNewPlacements();
// Update the baseline positions after each accepted drag step so that
// the orientation-flip check in validateNewPlacements() compares against
// the last accepted state rather than the pre-drag origin. Without this,
// cumulative rotation during a long drag easily exceeds the 91-degree
// threshold and causes the solver result to be rejected ("flipped
// orientation"), making parts appear to explode.
savePlacementsForUndo();
auto joints = getJoints(false);
for (auto* joint : joints) {
if (joint->Visibility.getValue()) {