]> Shamusworld >> Repos - architektonas/blobdiff - src/circle.cpp
Added layer attribute to load/save code.
[architektonas] / src / circle.cpp
index 909d30416bac3676beaf8d6d8cbe905184f04eb7..e73bcdc9607fb6dd209a088e87bfb5d696062a35 100644 (file)
@@ -59,7 +59,7 @@ Circle::~Circle()
        {
                QString text = QObject::tr("Radius: %1\nScale: %2%");
                text = text.arg(radius, 0, 'd', 4).arg(radius / oldRadius * 100.0, 0, 'd', 0);
-
+#if 0
                QPen pen = QPen(QColor(0x00, 0xFF, 0x00), 1.0, Qt::SolidLine);
                painter->SetPen(pen);
                painter->SetBrush(QBrush(QColor(0x40, 0xFF, 0x40, 0x9F)));
@@ -71,6 +71,9 @@ Circle::~Circle()
                pen = QPen(QColor(0x00, 0x5F, 0xDF));
                painter->SetPen(pen);
                painter->DrawText(textRect, Qt::AlignVCenter, text);
+#else
+               painter->DrawInformativeText(text);
+#endif
        }
 }
 
@@ -87,6 +90,11 @@ Circle::~Circle()
        objectWasDragged = false;
        HitTest(point);
 
+       // Now that we've done our hit testing on the non-snapped point, snap it if
+       // necessary...
+       if (snapToGrid)
+               point = SnapPointToGrid(point);
+
        draggingCenter = hitCenter;
        draggingEdge = hitCircle;
 
@@ -210,7 +218,7 @@ bool Circle::HitStateChanged(void)
 
 /*virtual*/ void Circle::Enumerate(FILE * file)
 {
-       fprintf(file, "CIRCLE (%lf,%lf) %lf\n", position.x, position.y, radius);
+       fprintf(file, "CIRCLE %i (%lf,%lf) %lf\n", layer, position.x, position.y, radius);
 }