X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fpainter.cpp;h=308cab6b7bd87ed587cb884ae52113f1173abaad;hb=bb8d0671717bac2c5350e34024273381be1d8175;hp=6cfd91f8ef62641d6584158631c6a3834866532a;hpb=70297ac8ec7453e4196f4b58056bcfe4b04f2aca;p=architektonas diff --git a/src/painter.cpp b/src/painter.cpp index 6cfd91f..308cab6 100644 --- a/src/painter.cpp +++ b/src/painter.cpp @@ -208,6 +208,7 @@ void Painter::DrawPoint(int x, int y) } +// This is drawn in Qt coordinates... void Painter::DrawRoundedRect(QRectF rect, double radiusX, double radiusY) { if (!painter) @@ -217,6 +218,22 @@ void Painter::DrawRoundedRect(QRectF rect, double radiusX, double radiusY) } +// This is drawn partially in Cartesian coordinates, and partially in Qt +// coordinates. The rect itself is in Cartesian but we want to pad it by a set +// number of pixels. +void Painter::DrawPaddedRect(QRectF rect) +{ + if (!painter) + return; + + Vector v1 = CartesianToQtCoords(Vector(rect.x(), rect.y())); + Vector v2 = CartesianToQtCoords(Vector(rect.right(), rect.bottom())); + 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) { if (!painter)