Sketcher: Fix Angle Constraint jumping to opposite side on movement (#24150)

* Sketcher: Fix Angle Constraint jumping to opposite side on movement

* implement way to dynamically disable snapping where not needed

---------

Co-authored-by: Matthias Danner <28687794+matthiasdanner@users.noreply.github.com>
This commit is contained in:
matthiasdanner
2025-10-13 18:07:09 +02:00
committed by GitHub
parent 45401513b4
commit 62c222c211
20 changed files with 197 additions and 120 deletions

View File

@@ -1153,12 +1153,7 @@ void SketchObject::reverseAngleConstraintToSupplementary(Constraint* constr, int
{
std::swap(constr->First, constr->Second);
std::swap(constr->FirstPos, constr->SecondPos);
if (constr->FirstPos == constr->SecondPos) {
constr->FirstPos = (constr->FirstPos == Sketcher::PointPos::start) ? Sketcher::PointPos::end : Sketcher::PointPos::start;
}
else {
constr->SecondPos = (constr->SecondPos == Sketcher::PointPos::start) ? Sketcher::PointPos::end : Sketcher::PointPos::start;
}
constr->FirstPos = (constr->FirstPos == Sketcher::PointPos::start) ? Sketcher::PointPos::end : Sketcher::PointPos::start;
// Edit the expression if any, else modify constraint value directly
if (constraintHasExpression(constNum)) {