mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
Added an alternative version of Path::addPieSegment()
This commit is contained in:
parent
5775d62810
commit
cd48446e89
2 changed files with 38 additions and 1 deletions
|
|
@ -656,6 +656,20 @@ void Path::addPieSegment (const float x, const float y,
|
|||
closeSubPath();
|
||||
}
|
||||
|
||||
void Path::addPieSegment (Rectangle<int> segmentBounds,
|
||||
const float fromRadians,
|
||||
const float toRadians,
|
||||
const float innerCircleProportionalSize)
|
||||
{
|
||||
addPieSegment (segmentBounds.getX(),
|
||||
segmentBounds.getY(),
|
||||
segmentBounds.getWidth(),
|
||||
segmentBounds.getHeight(),
|
||||
fromRadians,
|
||||
toRadians,
|
||||
innerCircleProportionalSize);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void Path::addLineSegment (const Line<float>& line, float lineThickness)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -489,7 +489,6 @@ public:
|
|||
@param innerCircleProportionalSize if this is > 0, then the pie will be drawn as a curved band around a hollow
|
||||
ellipse at its centre, where this value indicates the inner ellipse's size with
|
||||
respect to the outer one.
|
||||
|
||||
@see addArc
|
||||
*/
|
||||
void addPieSegment (float x, float y,
|
||||
|
|
@ -498,6 +497,30 @@ public:
|
|||
float toRadians,
|
||||
float innerCircleProportionalSize);
|
||||
|
||||
/** Adds a "pie-chart" shape to the path.
|
||||
|
||||
The shape is added as a new sub-path. (Any currently open paths will be
|
||||
left open).
|
||||
|
||||
Note that when specifying the start and end angles, the curve will be drawn either clockwise
|
||||
or anti-clockwise according to whether the end angle is greater than the start. This means
|
||||
that sometimes you may need to use values greater than 2*Pi for the end angle.
|
||||
|
||||
@param area the outer rectangle in which the elliptical outline fits
|
||||
@param fromRadians the angle (clockwise) in radians at which to start the arc segment (where 0 is the
|
||||
top-centre of the ellipse)
|
||||
@param toRadians the angle (clockwise) in radians at which to end the arc segment (where 0 is the
|
||||
top-centre of the ellipse)
|
||||
@param innerCircleProportionalSize if this is > 0, then the pie will be drawn as a curved band around a hollow
|
||||
ellipse at its centre, where this value indicates the inner ellipse's size with
|
||||
respect to the outer one.
|
||||
@see addArc
|
||||
*/
|
||||
void addPieSegment (Rectangle<int> segmentBounds,
|
||||
float fromRadians,
|
||||
float toRadians,
|
||||
float innerCircleProportionalSize);
|
||||
|
||||
/** Adds a line with a specified thickness.
|
||||
|
||||
The line is added as a new closed sub-path. (Any currently open paths will be
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue