]> Shamusworld >> Repos - architektonas/blobdiff - src/arc.cpp
Readded click to add dimension to object (for Line).
[architektonas] / src / arc.cpp
index f7cde5283c8befbf01926979e787d9afa1aa8c6b..36245b43dc70a2f3cdf160ca80155384bfcddfe2 100644 (file)
@@ -302,7 +302,8 @@ This vector is already unitized, so all we need to do to get our point is to
 multiply it by radius (to get the length correct) and add it to the center
 point (to get the correct position).
 */
-       Vector v1(point, position);     // Head minus tail (vector points at "point")
+//     Vector v1(point, position);     // Head minus tail (vector points at "point")
+       Vector v1(position, point);     // Head minus tail (vector points at "point")
        Point p1(cos(startAngle), sin(startAngle));
        Point p2(cos(startAngle + angleSpan), sin(startAngle + angleSpan));
        Vector handle2 = (p1 * radius) + position;
@@ -456,6 +457,18 @@ same reference number.
 }
 
 
+/*virtual*/ void Arc::Rotate(Point point, double angle)
+{
+       Point c1 = Geometry::RotatePointAroundPoint(position, point, angle);
+       Point ap1(cos(startAngle), sin(startAngle));
+       Point angleStartPoint = (ap1 * radius) + position;
+       Point c2 = Geometry::RotatePointAroundPoint(angleStartPoint, point, angle);
+
+       position = c1;
+       startAngle = Vector(c2, c1).Angle();
+}
+
+
 /*virtual*/ void Arc::Mirror(Point p1, Point p2)
 {
        Point c1 = Geometry::MirrorPointAroundLine(position, p1, p2);