diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerLine.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerLine.h index 1ca7c2d1ea..8b8cc322f0 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerLine.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerLine.h @@ -89,6 +89,8 @@ private: { switch (state()) { case SelectMode::SeekFirst: { + toolWidgetManager.drawPositionAtCursor(onSketchPos); + startPoint = onSketchPos; if (seekAutoConstraint(sugConstraints[0], onSketchPos, Base::Vector2d(0.f, 0.f))) { @@ -97,6 +99,8 @@ private: } } break; case SelectMode::SeekSecond: { + toolWidgetManager.drawDirectionAtCursor(onSketchPos, startPoint); + endPoint = onSketchPos; try { diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerOffset.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerOffset.h index 6ce60f9aa2..2aab721fc8 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerOffset.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerOffset.h @@ -132,6 +132,7 @@ private: if (!offsetLengthSet) { findOffsetLength(); + toolWidgetManager.drawDoubleAtCursor(onSketchPos, offsetLength); } if (fabs(offsetLength) > Precision::Confusion()) { diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerPoint.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerPoint.h index 65c17a2189..398410b298 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerPoint.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerPoint.h @@ -63,7 +63,7 @@ private: { switch (state()) { case SelectMode::SeekFirst: { - drawPositionAtCursor(onSketchPos); + toolWidgetManager.drawPositionAtCursor(onSketchPos); editPoint = onSketchPos; diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerPolygon.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerPolygon.h index 4d123d5089..9e075650f5 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerPolygon.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerPolygon.h @@ -78,6 +78,8 @@ private: { switch (state()) { case SelectMode::SeekFirst: { + toolWidgetManager.drawPositionAtCursor(onSketchPos); + centerPoint = onSketchPos; if (seekAutoConstraint(sugConstraints[0], onSketchPos, Base::Vector2d(0.f, 0.f))) { @@ -86,6 +88,8 @@ private: } } break; case SelectMode::SeekSecond: { + toolWidgetManager.drawDirectionAtCursor(onSketchPos, centerPoint); + firstCorner = onSketchPos; CreateAndDrawShapeGeometry(); diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h index 49878443c0..54c04b9640 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerRectangle.h @@ -100,7 +100,7 @@ private: { switch (state()) { case SelectMode::SeekFirst: { - drawPositionAtCursor(onSketchPos); + toolWidgetManager.drawPositionAtCursor(onSketchPos); if (constructionMethod() == ConstructionMethod::Diagonal || constructionMethod() == ConstructionMethod::ThreePoints) { @@ -117,7 +117,7 @@ private: } break; case SelectMode::SeekSecond: { if (constructionMethod() == ConstructionMethod::Diagonal) { - drawDirectionAtCursor(onSketchPos, corner1); + toolWidgetManager.drawDirectionAtCursor(onSketchPos, corner1); // Note : we swap corner2 and 4 to make sure the corners are CCW. // making things easier down the line. @@ -136,7 +136,7 @@ private: angle412 = M_PI / 2; } else if (constructionMethod() == ConstructionMethod::CenterAndCorner) { - drawDirectionAtCursor(onSketchPos, center); + toolWidgetManager.drawDirectionAtCursor(onSketchPos, center); corner1 = center - (onSketchPos - center); corner3 = onSketchPos; @@ -154,7 +154,7 @@ private: angle412 = M_PI / 2; } else if (constructionMethod() == ConstructionMethod::ThreePoints) { - drawDirectionAtCursor(onSketchPos, corner1); + toolWidgetManager.drawDirectionAtCursor(onSketchPos, corner1); corner2 = onSketchPos; Base::Vector2d perpendicular; @@ -168,7 +168,7 @@ private: side = getPointSideOfVector(corner3, corner2 - corner1, corner1); } else { - drawDirectionAtCursor(onSketchPos, center); + toolWidgetManager.drawDirectionAtCursor(onSketchPos, center); corner1 = onSketchPos; corner3 = center - (onSketchPos - center); @@ -193,6 +193,8 @@ private: try { CreateAndDrawShapeGeometry(); + + toolWidgetManager.drawWidthHeightAtCursor(onSketchPos, length, width); } catch (const Base::ValueError&) { } // equal points while hovering raise an objection that can be safely ignored @@ -207,10 +209,11 @@ private: || constructionMethod() == ConstructionMethod::CenterAndCorner) { if (roundCorners) { calculateRadius(onSketchPos); + toolWidgetManager.drawDoubleAtCursor(onSketchPos, radius); } - else { - calculateThickness( - onSketchPos); // This is the case of frame of normal rectangle. + else { // Normal rectangle with frame. + calculateThickness(onSketchPos); + toolWidgetManager.drawDoubleAtCursor(onSketchPos, thickness); } } else if (constructionMethod() == ConstructionMethod::ThreePoints) { @@ -242,6 +245,8 @@ private: else { radius = 0.; } + + toolWidgetManager.drawWidthHeightAtCursor(onSketchPos, length, width); } else { corner2 = onSketchPos; @@ -270,9 +275,7 @@ private: radius = 0.; } - SbString text; - text.sprintf(" (%.1f Angle)", angle412 / M_PI * 180); - setPositionText(onSketchPos, text); + toolWidgetManager.drawWidthHeightAtCursor(onSketchPos, length, width); } try { @@ -293,15 +296,17 @@ private: case SelectMode::SeekFourth: { if (constructionMethod() == ConstructionMethod::Diagonal || constructionMethod() == ConstructionMethod::CenterAndCorner) { - calculateThickness( - onSketchPos); // This is the case of frame of round corner rectangle. + calculateThickness(onSketchPos); + toolWidgetManager.drawDoubleAtCursor(onSketchPos, thickness); } else { if (roundCorners) { calculateRadius(onSketchPos); + toolWidgetManager.drawDoubleAtCursor(onSketchPos, radius); } else { calculateThickness(onSketchPos); + toolWidgetManager.drawDoubleAtCursor(onSketchPos, thickness); } } @@ -309,6 +314,7 @@ private: } break; case SelectMode::SeekFifth: { calculateThickness(onSketchPos); + toolWidgetManager.drawDoubleAtCursor(onSketchPos, thickness); CreateAndDrawShapeGeometry(); } break;