1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added a Path::addTriangle method that takes Point parameters

This commit is contained in:
jules 2014-11-12 10:52:44 +00:00
parent 455290ad91
commit 78bfab2d17
2 changed files with 25 additions and 6 deletions

View file

@ -501,13 +501,20 @@ void Path::addRoundedRectangle (float x, float y, float w, float h, float cs)
addRoundedRectangle (x, y, w, h, cs, cs);
}
void Path::addTriangle (const float x1, const float y1,
const float x2, const float y2,
const float x3, const float y3)
void Path::addTriangle (float x1, float y1,
float x2, float y2,
float x3, float y3)
{
startNewSubPath (x1, y1);
lineTo (x2, y2);
lineTo (x3, y3);
addTriangle (Point<float> (x1, y1),
Point<float> (x2, y2),
Point<float> (x3, y3));
}
void Path::addTriangle (Point<float> p1, Point<float> p2, Point<float> p3)
{
startNewSubPath (p1);
lineTo (p2);
lineTo (p3);
closeSubPath();
}

View file

@ -377,6 +377,18 @@ public:
float x2, float y2,
float x3, float y3);
/** Adds a triangle to the path.
The triangle is added as a new closed sub-path. (Any currently open paths will be left open).
Note that whether the vertices are specified in clockwise or anticlockwise
order will affect how the triangle is filled when it overlaps other
shapes (the winding order setting will affect this of course).
*/
void addTriangle (Point<float> point1,
Point<float> point2,
Point<float> point3);
/** Adds a quadrilateral to the path.
The quad is added as a new closed sub-path. (Any currently open paths will be left open).