Circle::Circle(Vector p1, double r, Object * p/*= NULL*/): Object(p1, p), radius(r),
draggingEdge(false), draggingCenter(false), hitCenter(false), hitCircle(false)
{
+ type = OTCircle;
}
/*virtual*/ void Circle::PointerMoved(Vector point)
{
+ if (selectionInProgress)
+ {
+ // Check for whether or not the rect contains this circle
+ if (selection.normalized().contains(Extents()))
+ state = OSSelected;
+ else
+ state = OSInactive;
+
+ return;
+ }
+
// Hit test tells us what we hit (if anything) through boolean variables. It
// also tells us whether or not the state changed.
needUpdate = HitTest(point);
}
-bool Circle::HitTest(Point point)
+/*virtual*/ bool Circle::HitTest(Point point)
{
SaveState();
hitCenter = hitCircle = false;
}
+/*virtual*/ QRectF Circle::Extents(void)
+{
+ return QRectF(QPointF(position.x - radius, position.y - radius), QPointF(position.x + radius, position.y + radius));
+}
+
+
void Circle::SaveState(void)
{
oldHitCenter = hitCenter;