]> Shamusworld >> Repos - ttedit/blobdiff - src/graphicprimitives.cpp
Fixed a handful of bugs related to clicking and dragging
[ttedit] / src / graphicprimitives.cpp
index 82e15ab323db6b2bf70e569808fa5707c94ced22..dd9b480e54650eca6ce7553d3326276da7de3511 100755 (executable)
@@ -23,6 +23,7 @@ double abs(double n)                                                  // Helper function
        return (n < 0 ? -n : n);
 }
 
+
 //
 // This function takes three points and draws a curve using a second order
 // Bezier function.
@@ -49,6 +50,16 @@ void Bezier(QPainter &p, point p1, point p2, point p3)
        p.drawLine(prevX, prevY, (int)p3.x, (int)p3.y);
 }
 
+
+//
+// This is a convenience funtion, using IPoints :-)
+//
+void Bezier(QPainter &p, IPoint p1, IPoint p2, IPoint p3)
+{
+       Bezier(p, point(p1.x, p1.y), point(p2.x, p2.y), point(p3.x, p3.y));
+}
+
+
 //
 // Draw a round dot (5x5, centered on [x, y])
 //
@@ -68,6 +79,7 @@ void DrawRoundDot(QPainter &p, int32 x, int32 y)
        p.drawPolygon(pt, 8);
 }
 
+
 //
 // Draw a sqaure dot (5x5, centered on [x, y])
 //
@@ -83,6 +95,7 @@ void DrawSquareDot(QPainter &p, int32 x, int32 y)
        p.drawPolygon(pt, 4);
 }
 
+
 //
 // Draw a sqaure dot (nxn, centered on [x, y])
 //
@@ -99,6 +112,7 @@ void DrawSquareDotN(QPainter &p, int32 x, int32 y, uint32 n)
        p.drawPolygon(pt, 4);
 }
 
+
 //
 // Draw a round dot (nxn, centered on [x, y])
 //