Browse Source

Added a version of Graphics::drawEllipse that takes a rectangle.

tags/2021-05-28
jules 12 years ago
parent
commit
6dda450ad6
2 changed files with 10 additions and 0 deletions
  1. +5
    -0
      modules/juce_graphics/contexts/juce_GraphicsContext.cpp
  2. +5
    -0
      modules/juce_graphics/contexts/juce_GraphicsContext.h

+ 5
- 0
modules/juce_graphics/contexts/juce_GraphicsContext.cpp View File

@@ -445,6 +445,11 @@ void Graphics::drawEllipse (float x, float y, float width, float height, float l
strokePath (p, PathStrokeType (lineThickness));
}
void Graphics::drawEllipse (const Rectangle<float>& area, float lineThickness) const
{
drawEllipse (area.getX(), area.getY(), area.getWidth(), area.getHeight(), lineThickness);
}
void Graphics::fillRoundedRectangle (float x, float y, float width, float height, float cornerSize) const
{
fillRoundedRectangle (coordsToRectangle (x, y, width, height), cornerSize);


+ 5
- 0
modules/juce_graphics/contexts/juce_GraphicsContext.h View File

@@ -352,6 +352,11 @@ public:
void drawEllipse (float x, float y, float width, float height,
float lineThickness) const;
/** Draws an elliptical stroke using the current colour or brush.
@see fillEllipse, Path::addEllipse
*/
void drawEllipse (const Rectangle<float>& area, float lineThickness) const;
//==============================================================================
/** Draws a line between two points.
The line is 1 pixel wide and drawn with the current colour or brush.


Loading…
Cancel
Save