diff --git a/src/Gui/SoDatumLabel.cpp b/src/Gui/SoDatumLabel.cpp index be787055e7..d80be8fb71 100644 --- a/src/Gui/SoDatumLabel.cpp +++ b/src/Gui/SoDatumLabel.cpp @@ -1456,7 +1456,7 @@ void SoDatumLabel::drawAngle(const SbVec3f* points, float& angle, SbVec3f& textO SbVec3f v0(cos(startangle+range/2),sin(startangle+range/2),0); // leave some space for the text - double textMargin = std::min(0.2F*range, this->imgWidth/(2*r)); + double textMargin = std::min(0.2F * abs(range), this->imgWidth / (2 * r)); textOffset = p0 + v0 * r; @@ -1465,8 +1465,12 @@ void SoDatumLabel::drawAngle(const SbVec3f* points, float& angle, SbVec3f& textO glDrawArc(p0, r, startangle+range/2.+textMargin, endangle); // Direction vectors for start and end lines - SbVec3f v1(cos(startangle),sin(startangle),0); - SbVec3f v2(cos(endangle),sin(endangle),0); + SbVec3f v1(cos(startangle), sin(startangle), 0); + SbVec3f v2(cos(endangle), sin(endangle), 0); + + if (range < 0) { + std::swap(v1, v2); + } SbVec3f pnt1 = p0 + (r - endLineLength1) * v1; SbVec3f pnt2 = p0 + (r + endLineLength12) * v1; @@ -1487,7 +1491,6 @@ void SoDatumLabel::drawAngle(const SbVec3f* points, float& angle, SbVec3f& textO SbVec3f dirEnd(-v2[1], v2[0], 0); SbVec3f endArrowBase = p0 + r * v2; glDrawArrow(endArrowBase, dirEnd, arrowWidth, arrowLength); - } void SoDatumLabel::drawSymmetric(const SbVec3f* points)