X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Farc.cpp;fp=src%2Farc.cpp;h=c9eab157d06a95676328644cc9fe388646154c2b;hb=baf67656b97e3d61e9223e66ebe4f554e364cd4a;hp=77c1ce942075772ece9e951e7dda9f261f0890dd;hpb=1969804ac3ae69f43ade5c40657954442e0916c2;p=architektonas diff --git a/src/arc.cpp b/src/arc.cpp index 77c1ce9..c9eab15 100644 --- a/src/arc.cpp +++ b/src/arc.cpp @@ -61,11 +61,11 @@ Arc::~Arc() // Draw the center point of the arc painter->SetPen(QPen(Qt::red, 2.0, Qt::DotLine)); - painter->DrawEllipse(position, 4.0, 4.0); + painter->DrawHandle(position); // Draw the rotation & span setting handles - painter->DrawEllipse(handle2, 4.0, 4.0); - painter->DrawEllipse(handle3, 4.0, 4.0); + painter->DrawHandle(handle2); + painter->DrawHandle(handle3); // If we're rotating or setting the span, draw an information panel // showing both absolute and relative angles being set. @@ -75,13 +75,6 @@ Arc::~Arc() double relAngle = (startAngle >= oldAngle ? startAngle - oldAngle : startAngle - oldAngle + (2.0 * PI)) * RADIANS_TO_DEGREES; -// painter->save(); -//close, but no cigar. we need to "invert" our transformation to make this work properly -// return QPoint(-offsetX + x, (size().height() - (-offsetY + y)) * +1.0); -// painter->translate(0, viewportHeight); -// painter->scale(1.0, -1.0); -// Give up for now; just paint the info panel in the upper left corner of the screen -// painter->resetTransform(); QString text; if (hitHandle2) @@ -105,7 +98,7 @@ Arc::~Arc() pen = QPen(QColor(0x00, 0xFF, 0x00), 1.0, Qt::SolidLine); painter->SetPen(pen); painter->SetBrush(QBrush(QColor(0x40, 0xFF, 0x40, 0x9F))); - QRectF textRect(10.0, 10.0, 220.0, 60.0); // x, y, w, h + QRectF textRect(10.0, 10.0, 260.0, 60.0); // x, y, w, h painter->DrawRoundedRect(textRect, 7.0, 7.0); textRect.setLeft(textRect.left() + 14); @@ -113,10 +106,7 @@ Arc::~Arc() pen = QPen(QColor(0xDF, 0x5F, 0x00), 1.0, Qt::SolidLine); painter->SetPen(pen); painter->DrawText(textRect, Qt::AlignVCenter, text); -// painter->Restore(); } - -// painter->setPen(QPen(Qt::red, 2.0, Qt::DotLine)); } else { @@ -124,15 +114,7 @@ Arc::~Arc() painter->SetPen(pen); } -#if 0 - QRectF rectangle(QPointF(position.x - radius, position.y - radius), - QPointF(position.x + radius, position.y + radius)); - int angle1 = (int)(startAngle * RADIANS_TO_DEGREES * 16.0); - int angle2 = (int)(angleSpan * RADIANS_TO_DEGREES * 16.0); - painter->DrawArc(rectangle, -angle1, -angle2); -#else painter->DrawArc(position, radius, startAngle, angleSpan); -#endif } /*virtual*/ Vector Arc::Center(void)