mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-07 04:10:08 +00:00
Added some assertions in Graphics methods to catch negatively-sized rectangles.
This commit is contained in:
parent
0fa2b1ca56
commit
39a1727223
1 changed files with 4 additions and 2 deletions
|
|
@ -32,8 +32,8 @@ namespace
|
|||
|
||||
jassert ((int) x >= -maxVal && (int) x <= maxVal
|
||||
&& (int) y >= -maxVal && (int) y <= maxVal
|
||||
&& (int) w >= -maxVal && (int) w <= maxVal
|
||||
&& (int) h >= -maxVal && (int) h <= maxVal);
|
||||
&& (int) w >= 0 && (int) w <= maxVal
|
||||
&& (int) h >= 0 && (int) h <= maxVal);
|
||||
#endif
|
||||
|
||||
return Rectangle<Type> (x, y, w, h);
|
||||
|
|
@ -427,6 +427,8 @@ void Graphics::drawRect (const Rectangle<int>& r, int lineThickness) const
|
|||
|
||||
void Graphics::drawRect (Rectangle<float> r, const float lineThickness) const
|
||||
{
|
||||
jassert (r.getWidth() >= 0.0f && r.getHeight() >= 0.0f);
|
||||
|
||||
RectangleList<float> rects;
|
||||
rects.addWithoutMerging (r.removeFromTop (lineThickness));
|
||||
rects.addWithoutMerging (r.removeFromBottom (lineThickness));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue