X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdimension.cpp;h=27823b39135fb8f7f7ed87f4d482476672a42b19;hb=9590e4ed45fd4e05eccc16bd8e9d51596aea5a6d;hp=b3f1e7f3d915d0392c37abe7c2d01b8826b13b95;hpb=565c33c91ea355528145ba94b31b2e44309d0834;p=architektonas diff --git a/src/dimension.cpp b/src/dimension.cpp index b3f1e7f..27823b3 100644 --- a/src/dimension.cpp +++ b/src/dimension.cpp @@ -78,9 +78,9 @@ all objects move as a unified whole. if ((state == OSSelected) || ((state == OSInactive) && hitPoint2)) painter->DrawHandle(endpoint); -#if 0 +#if 1 if (state == OSSelected) - painter->SetPen(QPen(Qt::red, 2.0, Qt::DotLine)); + painter->SetPen(QPen(Qt::cyan, 1.0 * Painter::zoom * size, Qt::SolidLine)); else // painter->SetPen(QPen(Qt::blue, 1.0, Qt::SolidLine)); #endif @@ -219,44 +219,18 @@ I believe they are pixels. /*virtual*/ void Dimension::PointerMoved(Vector point) { -#if 0 - // We know this is true because mouse move messages don't come here unless - // the object was actually clicked on--therefore we *know* we're being - // dragged... - objectWasDragged = true; - -/* if (dragging) - { - // Here we need to check whether or not we're dragging a handle or the object itself... - Vector delta = point - oldPoint; - - position += delta; - endpoint += delta; - - oldPoint = point; - needUpdate = true; - } - else*/ if (draggingHandle1) + if (selectionInProgress) { - Vector delta = point - oldPoint; - - position += delta; + // Check for whether or not the rect contains this line + if (selection.contains(position.x, position.y) + && selection.contains(endpoint.x, endpoint.y)) + state = OSSelected; + else + state = OSInactive; - oldPoint = point; - needUpdate = true; + return; } - else if (draggingHandle2) - { - Vector delta = point - oldPoint; - - endpoint += delta; - oldPoint = point; - needUpdate = true; - } - else - needUpdate = false; -#else // Hit test tells us what we hit (if anything) through boolean variables. (It // also tells us whether or not the state changed. --not any more) SaveHitState(); @@ -278,7 +252,6 @@ I believe they are pixels. oldPoint = point; needUpdate = true; } -#endif }