#include "painter.h"
#include "mathconstants.h"
-#include "object.h"
+//#include "object.h"
+#include "global.h"
// Set class variable defaults
}
+// This function is for drawing object handles without regard for zoom level;
+// we don't want our object handle size to depend on the zoom level!
+void Painter::DrawArrowToLineHandle(Vector center, double angle)
+{
+ DrawArrowHandle(center, angle);
+ center = CartesianToQtCoords(center);
+
+ // 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);
+ Vector orthogonal = Vector(cos(orthoAngle), sin(orthoAngle));
+ Vector unit = Vector(cos(-angle), sin(-angle));
+
+ Point p1 = center + (unit * 21.0);
+ Point p2 = p1 + (orthogonal * 7.0);
+ Point p3 = p1 - (orthogonal * 7.0);
+
+ painter->drawLine(p2.x, p2.y, p3.x, p3.y);
+}
+
+
void Painter::DrawLine(int x1, int y1, int x2, int y2)
{
if (!painter)
void Painter::DrawInformativeText(QString text)
{
- painter->setFont(*Object::font);
+ painter->setFont(*Global::font);
QRectF bounds = painter->boundingRect(QRectF(), Qt::AlignVCenter, text);
bounds.moveTo(17.0, 17.0);
QRectF textRect = bounds;