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
|
|
@ -524,6 +524,9 @@ void CoreGraphicsContext::fillRect (const Rectangle<float>& r)
|
|||
|
||||
void CoreGraphicsContext::fillCGRect (const CGRect& cgRect, bool replaceExistingContents)
|
||||
{
|
||||
if (CGRectIsEmpty (cgRect))
|
||||
return;
|
||||
|
||||
if (replaceExistingContents)
|
||||
{
|
||||
CGContextSetBlendMode (context.get(), kCGBlendModeCopy);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -2180,6 +2180,9 @@ public:
|
|||
|
||||
void fillRect (Rectangle<int> r, bool replaceContents)
|
||||
{
|
||||
if (r.isEmpty())
|
||||
return;
|
||||
|
||||
if (clip != nullptr)
|
||||
{
|
||||
if (transform.isOnlyTranslated)
|
||||
|
|
@ -2201,6 +2204,9 @@ public:
|
|||
|
||||
void fillRect (Rectangle<float> r)
|
||||
{
|
||||
if (r.isEmpty())
|
||||
return;
|
||||
|
||||
if (clip != nullptr)
|
||||
{
|
||||
if (transform.isOnlyTranslated)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue