#include "circle.h"
#include <QtGui>
+#include "geometry.h"
#include "painter.h"
/*virtual*/ bool Circle::Collided(Vector point)
{
+ // Someone told us to fuck off, so we'll fuck off. :-)
+ if (ignoreClicks)
+ return false;
+
// We can assume this, since this is a mouse down event here.
objectWasDragged = false;
HitTest(point);
}
-/*virtual*/ void Circle::PointerMoved(Vector point)
+/*virtual*/ bool Circle::PointerMoved(Vector point)
{
if (selectionInProgress)
{
else
state = OSInactive;
- return;
+ return false;
}
// Hit test tells us what we hit (if anything) through boolean variables. It
// also tells us whether or not the state changed.
SaveHitState();
- HitTest(point);
+ bool hovered = HitTest(point);
needUpdate = HitStateChanged();
objectWasDragged = (draggingEdge | draggingCenter);
// Save this point so the rendering code knows where to draw the handle...
dragPoint = point;
+ return hovered;
}
return new Circle(position, radius, parent);
}
+
+/*virtual*/ void Circle::Rotate(Point point, double angle)
+{
+ Point c1 = Geometry::RotatePointAroundPoint(position, point, angle);
+ position = c1;
+}
+
+
+/*virtual*/ void Circle::Mirror(Point p1, Point p2)
+{
+ Point c1 = Geometry::MirrorPointAroundLine(position, p1, p2);
+ position = c1;
+}
+
+
+/*virtual*/ void Circle::Save(void)
+{
+ Object::Save();
+ oldRadius2 = radius;
+}
+
+
+/*virtual*/ void Circle::Restore(void)
+{
+ Object::Restore();
+ radius = oldRadius2;
+}
+