diff --git a/src/Mod/Sketcher/Gui/DrawSketchController.h b/src/Mod/Sketcher/Gui/DrawSketchController.h index c36cfe7de4..071e616ede 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchController.h +++ b/src/Mod/Sketcher/Gui/DrawSketchController.h @@ -480,10 +480,12 @@ public: } } - void drawDoubleAtCursor(const Base::Vector2d& position, const double radius) + void drawDoubleAtCursor(const Base::Vector2d& position, + const double radius, + Base::Unit unit = Base::Unit::Length) { if (shouldDrawDimensionsAtCursor()) { - handler->drawDoubleAtCursor(position, radius); + handler->drawDoubleAtCursor(position, radius, unit); } } diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp index 75d219057d..8b9ff87809 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp +++ b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp @@ -1173,14 +1173,18 @@ void DrawSketchHandler::drawWidthHeightAtCursor(const Base::Vector2d& position, setPositionText(position, text); } -void DrawSketchHandler::drawDoubleAtCursor(const Base::Vector2d& position, const double val) +void DrawSketchHandler::drawDoubleAtCursor(const Base::Vector2d& position, + const double val, + Base::Unit unit) { if (!showCursorCoords()) { return; } SbString text; - std::string doubleString = lengthToDisplayFormat(val, 1); + std::string doubleString = unit == Base::Unit::Length + ? lengthToDisplayFormat(val, 1) + : angleToDisplayFormat(val * 180.0 / M_PI, 1); text.sprintf(" (%s)", doubleString.c_str()); setPositionText(position, text); } diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandler.h b/src/Mod/Sketcher/Gui/DrawSketchHandler.h index e16ef0b952..c12a39e3c2 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandler.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandler.h @@ -284,7 +284,9 @@ protected: void drawDirectionAtCursor(const Base::Vector2d& position, const Base::Vector2d& origin); void drawWidthHeightAtCursor(const Base::Vector2d& position, const double val1, const double val2); - void drawDoubleAtCursor(const Base::Vector2d& position, const double radius); + void drawDoubleAtCursor(const Base::Vector2d& position, + const double radius, + Base::Unit unit = Base::Unit::Length); int getPreselectPoint() const; int getPreselectCurve() const;