X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fpainter.cpp;h=2314a8559b4de310848a8af737096b0e829b3712;hb=3c890e51a9763ffcee49e15753453a7da248272b;hp=853d3502690a494afdeb3635925d275fa087e6c8;hpb=41644f6a841b45cb6f1f7a96c93fd550f67a7974;p=architektonas diff --git a/src/painter.cpp b/src/painter.cpp index 853d350..2314a85 100644 --- a/src/painter.cpp +++ b/src/painter.cpp @@ -372,6 +372,16 @@ void Painter::DrawPoint(int x, int y) painter->drawPoint(v.x, v.y); } +// The rect passed in is in Qt coordinates... (?) +void Painter::DrawRoundedRect(Rect rect, double radiusX, double radiusY) +{ + if (!painter) + return; + + QRectF r(QPointF(rect.l, rect.t), QPointF(rect.r, rect.b)); + painter->drawRoundedRect(r, radiusX, radiusY); +} + // The rect passed in is in Qt coordinates... void Painter::DrawRoundedRect(QRectF rect, double radiusX, double radiusY) { @@ -383,35 +393,36 @@ void Painter::DrawRoundedRect(QRectF rect, double radiusX, double radiusY) // The rect passed in is in Cartesian but we want to pad it by a set number of // pixels (currently set at 8), so the pad looks the same regardless of zoom. -void Painter::DrawPaddedRect(QRectF rect) +void Painter::DrawPaddedRect(Rect rect) { if (!painter) return; - Vector v1 = CartesianToQtCoords(Vector(rect.x(), rect.y())); - Vector v2 = CartesianToQtCoords(Vector(rect.right(), rect.bottom())); + Vector v1 = CartesianToQtCoords(rect.TopLeft()); + Vector v2 = CartesianToQtCoords(rect.BottomRight()); QRectF screenRect(QPointF(v1.x, v1.y), QPointF(v2.x, v2.y)); screenRect.adjust(-8, 8, 8, -8); // Left/top, right/bottom painter->drawRect(screenRect); } -void Painter::DrawRect(QRectF rect) +void Painter::DrawRect(Rect rect) { if (!painter) return; - Vector v1 = CartesianToQtCoords(Vector(rect.x(), rect.y())); - Vector v2 = CartesianToQtCoords(Vector(rect.right(), rect.bottom())); + Vector v1 = CartesianToQtCoords(rect.TopLeft()); + Vector v2 = CartesianToQtCoords(rect.BottomRight()); QRectF screenRect(QPointF(v1.x, v1.y), QPointF(v2.x, v2.y)); painter->drawRect(screenRect); } -void Painter::DrawText(QRectF rect, int type, QString text) +void Painter::DrawText(Rect rect, int type, QString text) { if (!painter) return; - painter->drawText(rect, (Qt::AlignmentFlag)type, text); + QRectF r(QPointF(rect.l, rect.t), QPointF(rect.r, rect.b)); + painter->drawText(r, (Qt::AlignmentFlag)type, text); } void Painter::DrawArrowhead(Vector head, Vector tail, double size)