X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdrawingview.cpp;fp=src%2Fdrawingview.cpp;h=78fe9619a4a37d64e4de014971e8112b9defa7f9;hb=dacd9dc2c1ac093e4945f7befaeb5ff1801a0f52;hp=e65bbe92de99f12d47f6f2e12596c25d33485c1d;hpb=10cf4c797bed05831e976068b7504908279dc997;p=architektonas diff --git a/src/drawingview.cpp b/src/drawingview.cpp index e65bbe9..78fe961 100644 --- a/src/drawingview.cpp +++ b/src/drawingview.cpp @@ -2752,7 +2752,10 @@ bool DrawingView::HitTest(Object * obj, Point point) } if (objDist < 5.0) + { pl->hitObject = true; + pl->ptNum = i; + } } else { @@ -2771,7 +2774,10 @@ bool DrawingView::HitTest(Object * obj, Point point) span -= TAU; if (((fabs(length - a.radius[0]) * Global::zoom) < 2.5) && (fabs(span) < fabs(a.angle[1]))) + { pl->hitObject = true; + pl->ptNum = i; + } } } @@ -3143,18 +3149,30 @@ N.B.: Mixing fixed length with fixed angle (and in this order) is probably *not* case OTPolyline: { -#if 1 - // Do this for now... - ((Polyline *)obj)->Translate(delta); -// Polyline * pl = (Polyline *)obj; - -// for(long unsigned int i=0; ipoints.size(); i++) -// pl->points[i] += delta; -#else Polyline * pl = (Polyline *)obj; - for(long unsigned int i=0; i<(pl->points.size()-1); i++) -#endif + if (!shiftDown) + pl->Translate(delta); + else + { + // Move selected point by itself (if hit) + if (pl->hitPoint[0]) + { + point.b = pl->points[pl->ptNum].b; + pl->points[pl->ptNum] = point; + } + else if (pl->hitObject) + { + // move arc radius, or maybe move line segment? :-/ + int ptNum = pl->ptNum; + Arc a = Geometry::FindArcForThreePoints(pl->points[ptNum], pl->points[ptNum + 1], point); + pl->points[ptNum].b = Geometry::Pack(&a); + + // This doesn't quite get there... Maybe < 0.001? + if (fabs(pl->points[ptNum].b) < EPSILON) + pl->points[ptNum].b = 0; + } + } break; } @@ -3166,7 +3184,7 @@ N.B.: Mixing fixed length with fixed angle (and in this order) is probably *not* obj->p[1] = point; else if (obj->hitObject) { - // Move measurement lines in/out + // Move extension lines in/out if (shiftDown) { Dimension * d = (Dimension *)obj;