X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fcircle.cpp;h=ed37be3fcd7268faf59cfcb3906316f69a447045;hb=6c1279871f6bb86bc59e2561b6a7f74ab081f71e;hp=093f53395834bd3472a05a3242ad148bd1cc8759;hpb=7f3a6b11585376eecd80979ec3da2346c5314d88;p=architektonas diff --git a/src/circle.cpp b/src/circle.cpp index 093f533..ed37be3 100644 --- a/src/circle.cpp +++ b/src/circle.cpp @@ -135,6 +135,11 @@ Circle::~Circle() return false; } +/* +Note that we can separate this out in the TLC, and it would probably make more sense +to do it there as then we can be assured that all hit testing is done before we do +any snapping. !!! FIX !!! +*/ // Hit test tells us what we hit (if anything) through boolean variables. It // also tells us whether or not the state changed. SaveHitState(); @@ -183,8 +188,8 @@ Circle::~Circle() double length = Vector::Magnitude(position, point); //printf("Circle::length = %lf, radius = %lf\n", length, radius); //How to translate this into pixels from Document space??? -//Maybe we need to pass a scaling factor in here from the caller? That would make sense, as -//the caller knows about the zoom factor and all that good kinda crap +//Maybe we need to pass a scaling factor in here from the caller? That would make +//sense, as the caller knows about the zoom factor and all that good kinda crap /* Document passes in the correct Cartesian coordinates being pointed to by the mouse. So all we have to be concerned with is properly scaling our hot zones/handle sizes, @@ -198,8 +203,13 @@ pointed at length with our on screen length. if ((length * Painter::zoom) < 8.0) { hitCenter = true; - snapPoint = position; - snapPointIsValid = true; + + // Make sure we don't try to snap to ourselves...! + if (!draggingCenter) + { + 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 */