DSH : modify drawDoubleAtCursor so that it can draw an angle.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user