Browse Source

tags/2021-05-28
jules 18 years ago
parent
commit
e79e69be54
2 changed files with 51 additions and 0 deletions
  1. +26
    -0
      src/juce_appframework/gui/graphics/contexts/juce_Graphics.cpp
  2. +25
    -0
      src/juce_appframework/gui/graphics/contexts/juce_Graphics.h

+ 26
- 0
src/juce_appframework/gui/graphics/contexts/juce_Graphics.cpp View File

@@ -455,6 +455,14 @@ void Graphics::drawRect (const int x,
b.paintRectangle (*context, x, y + height - lineThickness, width, lineThickness); b.paintRectangle (*context, x, y + height - lineThickness, width, lineThickness);
} }
void Graphics::drawRect (const Rectangle& r,
const int lineThickness) const throw()
{
drawRect (r.getX(), r.getY(),
r.getWidth(), r.getHeight(),
lineThickness);
}
void Graphics::drawBevel (const int x, void Graphics::drawBevel (const int x,
const int y, const int y,
const int width, const int width,
@@ -527,6 +535,14 @@ void Graphics::fillRoundedRectangle (const float x,
fillPath (p); fillPath (p);
} }
void Graphics::fillRoundedRectangle (const Rectangle& r,
const float cornerSize) const throw()
{
fillRoundedRectangle (r.getX(), r.getY(),
r.getWidth(), r.getHeight(),
cornerSize);
}
void Graphics::drawRoundedRectangle (const float x, void Graphics::drawRoundedRectangle (const float x,
const float y, const float y,
const float width, const float width,
@@ -542,6 +558,16 @@ void Graphics::drawRoundedRectangle (const float x,
strokePath (p, PathStrokeType (lineThickness)); strokePath (p, PathStrokeType (lineThickness));
} }
void Graphics::drawRoundedRectangle (const Rectangle& r,
const float cornerSize,
const float lineThickness) const throw()
{
drawRoundedRectangle (r.getX(), r.getY(),
r.getWidth(), r.getHeight(),
cornerSize, lineThickness);
}
void Graphics::drawArrow (const float startX, void Graphics::drawArrow (const float startX,
const float startY, const float startY,
const float endX, const float endX,


+ 25
- 0
src/juce_appframework/gui/graphics/contexts/juce_Graphics.h View File

@@ -275,6 +275,13 @@ public:
const float height, const float height,
const float cornerSize) const throw(); const float cornerSize) const throw();
/** Uses the current colour or brush to fill a rectangle with rounded corners.
@see drawRoundedRectangle, Path::addRoundedRectangle
*/
void fillRoundedRectangle (const Rectangle& rectangle,
const float cornerSize) const throw();
/** Fills a rectangle with a checkerboard pattern, alternating between two colours. /** Fills a rectangle with a checkerboard pattern, alternating between two colours.
*/ */
void fillCheckerBoard (int x, int y, void fillCheckerBoard (int x, int y,
@@ -297,6 +304,16 @@ public:
const int height, const int height,
const int lineThickness = 1) const throw(); const int lineThickness = 1) const throw();
/** Draws four lines to form a rectangular outline, using the current colour or brush.
The lines are drawn inside the given rectangle, and greater line thicknesses
extend inwards.
@see fillRect
*/
void drawRect (const Rectangle& rectangle,
const int lineThickness = 1) const throw();
/** Uses the current colour or brush to draw the outline of a rectangle with rounded corners. /** Uses the current colour or brush to draw the outline of a rectangle with rounded corners.
@see fillRoundedRectangle, Path::addRoundedRectangle @see fillRoundedRectangle, Path::addRoundedRectangle
@@ -308,6 +325,14 @@ public:
const float cornerSize, const float cornerSize,
const float lineThickness) const throw(); const float lineThickness) const throw();
/** Uses the current colour or brush to draw the outline of a rectangle with rounded corners.
@see fillRoundedRectangle, Path::addRoundedRectangle
*/
void drawRoundedRectangle (const Rectangle& rectangle,
const float cornerSize,
const float lineThickness) const throw();
/** Draws a 3D raised (or indented) bevel using two colours. /** Draws a 3D raised (or indented) bevel using two colours.
The bevel is drawn inside the given rectangle, and greater bevel thicknesses The bevel is drawn inside the given rectangle, and greater bevel thicknesses


Loading…
Cancel
Save