DSH : modify drawDoubleAtCursor so that it can draw an angle.

This commit is contained in:
Paddle
2023-11-11 22:16:01 +01:00
committed by abdullahtahiriyo
parent dfd4d6a6d9
commit c2bb84de8e
3 changed files with 13 additions and 5 deletions

View File

@@ -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);
}