X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fcircle.cpp;h=94a9ec8f807b47b5e867bb3e5fab79b951c46c3a;hb=771113b26ca27707c96fdcd80d79a08e40884268;hp=e73bcdc9607fb6dd209a088e87bfb5d696062a35;hpb=11cff81f10ccca1b31288fce04d696e715b922b0;p=architektonas diff --git a/src/circle.cpp b/src/circle.cpp index e73bcdc..94a9ec8 100644 --- a/src/circle.cpp +++ b/src/circle.cpp @@ -16,6 +16,7 @@ #include "circle.h" #include +#include "geometry.h" #include "painter.h" @@ -86,6 +87,10 @@ Circle::~Circle() /*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); @@ -113,7 +118,7 @@ Circle::~Circle() } -/*virtual*/ void Circle::PointerMoved(Vector point) +/*virtual*/ bool Circle::PointerMoved(Vector point) { if (selectionInProgress) { @@ -124,13 +129,13 @@ Circle::~Circle() 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); @@ -144,6 +149,7 @@ Circle::~Circle() // Save this point so the rendering code knows where to draw the handle... dragPoint = point; + return hovered; } @@ -237,3 +243,31 @@ same reference number. 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; +} +