mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
GraphicsContext: Avoid attempting to paint empty rectangles in all renderers
This commit is contained in:
parent
06137fb7f5
commit
5b2f9d4019
3 changed files with 15 additions and 0 deletions
|
|
@ -1167,6 +1167,9 @@ void Direct2DGraphicsContext::setInterpolationQuality (Graphics::ResamplingQuali
|
|||
|
||||
void Direct2DGraphicsContext::fillRect (const Rectangle<int>& r, bool replaceExistingContents)
|
||||
{
|
||||
if (r.isEmpty())
|
||||
return;
|
||||
|
||||
if (replaceExistingContents)
|
||||
clipToRectangle (r);
|
||||
|
||||
|
|
@ -1187,6 +1190,9 @@ void Direct2DGraphicsContext::fillRect (const Rectangle<int>& r, bool replaceExi
|
|||
|
||||
void Direct2DGraphicsContext::fillRect (const Rectangle<float>& r)
|
||||
{
|
||||
if (r.isEmpty())
|
||||
return;
|
||||
|
||||
auto fill = [] (Rectangle<float> rect, ComSmartPtr<ID2D1DeviceContext1> deviceContext, ComSmartPtr<ID2D1Brush> brush)
|
||||
{
|
||||
if (brush != nullptr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue