Sketcher: Fix snap while drag and fix drag for arc

Signed-off-by: Yash Suthar <[email protected]>
This commit is contained in:
Yash Suthar
2026-02-10 10:20:11 -06:00
committed by Chris Hennes
parent 0eaf14373f
commit 2cd45b07f7
+11 -2
View File
@@ -1634,7 +1634,14 @@ void ViewProviderSketch::initDragging(int geoId, Sketcher::PointPos pos, Gui::Vi
// 2 cases : either the edge was added or a point of it.
// If its a point then we replace it by the edge.
// If it's the edge it's replaced by itself so it's ok.
drag.Dragged[0].Pos = Sketcher::PointPos::none;
// for arcs preserve mid point drags for rigid movement
const Part::Geometry* geo = getSketchObject()->getGeometry(geoIdi);
bool isArcMidDrag = (pos == Sketcher::PointPos::mid) && isArcOfCircle(*geo);
if (!isArcMidDrag) {
drag.Dragged[0].Pos = Sketcher::PointPos::none;
}
}
else {
// For group dragging, we skip the internal geos.
@@ -1753,7 +1760,9 @@ void ViewProviderSketch::initDragging(int geoId, Sketcher::PointPos pos, Gui::Vi
}
}
if (geo->is<Part::GeomLineSegment>() || geo->is<Part::GeomBSplineCurve>()) {
if (geo->is<Part::GeomLineSegment>() || geo->is<Part::GeomBSplineCurve>()
|| isEllipse(*geo) || isArcOfEllipse(*geo)
|| isArcOfHyperbola(*geo) || isArcOfParabola(*geo)) {
setRelative();
}