X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fcircle.cpp;h=093f53395834bd3472a05a3242ad148bd1cc8759;hb=7f3a6b11585376eecd80979ec3da2346c5314d88;hp=94a9ec8f807b47b5e867bb3e5fab79b951c46c3a;hpb=c85958d34fac175452fe420ff24ea82f26d6f1f3;p=architektonas diff --git a/src/circle.cpp b/src/circle.cpp index 94a9ec8..093f533 100644 --- a/src/circle.cpp +++ b/src/circle.cpp @@ -100,6 +100,9 @@ Circle::~Circle() if (snapToGrid) point = SnapPointToGrid(point); + if (snapPointIsValid) + point = snapPoint; + draggingCenter = hitCenter; draggingEdge = hitCircle; @@ -137,6 +140,13 @@ Circle::~Circle() SaveHitState(); bool hovered = HitTest(point); needUpdate = HitStateChanged(); + + if (snapToGrid) + point = SnapPointToGrid(point); + + if (snapPointIsValid) + point = snapPoint; + objectWasDragged = (draggingEdge | draggingCenter); if (objectWasDragged) @@ -186,7 +196,11 @@ the radius will be 5.0. By multiplying the length by the zoom factor, we align o pointed at length with our on screen length. */ if ((length * Painter::zoom) < 8.0) + { hitCenter = true; + snapPoint = position; + snapPointIsValid = true; + } //wrong: else if ((length < (radius + 2.0)) && (length > (radius - 2.0))) /*NB: The following should be identical to what we have down below, but it doesn't work out that way... :-P */ //close, but no else if (((length * Painter::zoom) < ((radius * Painter::zoom) + 2.0)) && ((length * Painter::zoom) > ((radius * Painter::zoom) - 2.0)))