}
+//
+// Return the non-rotated rectangle containing the extents of the text in
+// Cartesian coordiates (starting from <0, 0>, the lower left hand side)
+//
+Rect Painter::MeasureTextObject(QString text, double size)
+{
+ if (!painter)
+ return Rect();
+
+ painter->setFont(QFont("Arial", Global::zoom * size));
+ int textWidth = QFontMetrics(painter->font()).width(text);
+ int textHeight = QFontMetrics(painter->font()).height();
+ Point measured((double)textWidth / Global::zoom, (double)textHeight / Global::zoom);// = QtToCartesianCoords(Point(textWidth, textHeight));
+//printf("QFontMetrics w/h=%i/%i, measured=%lf/%lf\n", textWidth, textHeight, measured.x, measured.y);
+
+ return Rect(Point(0, 0), measured);
+}
+
+
void Painter::DrawArc(Vector center, double radius, double startAngle, double span)
{
if (!painter)
if (!painter)
return;
-// QRectF screenRect(QPointF(v1.x, v1.y), QPointF(v2.x, v2.y));
-
Vector v1 = CartesianToQtCoords(Vector(rect.l, rect.t));
Vector v2 = CartesianToQtCoords(Vector(rect.r, rect.b));
-// 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);
v1 += Vector(-8.0, -8.0);
v2 += Vector(+8.0, +8.0);
painter->setPen(QPen(Qt::red, 2.0, Qt::DashLine));