X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fpainter.cpp;h=e8aaba1cf04cc8f7602a9d587884c0309f0e7222;hb=0fcc2d879e1e0ca17eeaceae2159f5143a06586f;hp=5bd5ae412eb7681f78d133e7f170b4bb4e733da5;hpb=6a7baa2814a8b4d0b93df776a4c99689bcfb3ffa;p=architektonas diff --git a/src/painter.cpp b/src/painter.cpp index 5bd5ae4..e8aaba1 100644 --- a/src/painter.cpp +++ b/src/painter.cpp @@ -148,11 +148,19 @@ void Painter::DrawAngledText(Vector center, double angle, QString text, double s float yOffset = -12.0 * Global::zoom * size; // Fix text so it isn't upside down... +#if 0 if ((angle > PI * 0.5) && (angle < PI * 1.5)) { angle += PI; yOffset = 12.0 * Global::zoom * size; } +#else + if ((angle > QTR_TAU) && (angle < THREE_QTR_TAU)) + { + angle += HALF_TAU; + yOffset = 12.0 * Global::zoom * size; + } +#endif textBox.translate(0, yOffset); painter->save(); @@ -230,7 +238,7 @@ void Painter::DrawArrowHandle(Vector center, double angle) // Since we're drawing directly on the screen, the Y is inverted. So we use // the mirror of the angle. - double orthoAngle = -angle + (PI / 2.0); + double orthoAngle = -angle + QTR_TAU;//(PI / 2.0); Vector orthogonal = Vector(cos(orthoAngle), sin(orthoAngle)); Vector unit = Vector(cos(-angle), sin(-angle)); @@ -256,7 +264,7 @@ void Painter::DrawArrowToLineHandle(Vector center, double angle) // Since we're drawing directly on the screen, the Y is inverted. So we use // the mirror of the angle. - double orthoAngle = -angle + (PI / 2.0); + double orthoAngle = -angle + QTR_TAU;//(PI / 2.0); Vector orthogonal = Vector(cos(orthoAngle), sin(orthoAngle)); Vector unit = Vector(cos(-angle), sin(-angle)); @@ -355,7 +363,7 @@ void Painter::DrawArrowhead(Vector head, Vector tail, double size) // We draw the arrowhead aligned along the line from tail to head double angle = Vector(head - tail).Angle(); - double orthoAngle = angle + (PI / 2.0); + double orthoAngle = angle + QTR_TAU;//(PI / 2.0); Vector orthogonal = Vector(cos(orthoAngle), sin(orthoAngle)); Vector unit = Vector(head - tail).Unit();