Sketcher: Fix negative angle rendering negative bug

This commit is contained in:
PaddleStroke
2025-03-13 15:28:23 +01:00
committed by GitHub
parent c1fd2ba4a5
commit 61801fd727

View File

@@ -80,9 +80,6 @@ void glDrawLine(const SbVec3f& p1, const SbVec3f& p2){
void glDrawArc(const SbVec3f& center, float radius, float startAngle=0., float endAngle=2.0*M_PI, int countSegments=0){
float range = endAngle - startAngle;
if (range < 0.) {
range += 2.0 * M_PI;
}
if (countSegments == 0){
countSegments = std::max(6, abs(int(25.0 * range / M_PI)));
@@ -1446,7 +1443,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 * std::abs(range), this->imgWidth / (2 * r));
textOffset = p0 + v0 * r;