From 715608fe6ab2a746eed112036f41f62d7d9dbaa7 Mon Sep 17 00:00:00 2001 From: arturs Date: Sun, 2 Jul 2017 15:06:06 +0200 Subject: [PATCH] Return (0,0,0,0) rectangle if clipping region is empty When clipping region is empty, CGContextGetClipBoundingBox() returns (+Inf,+Inf,0,0) rectangle but we need to return (0,0,0,0) rectangle in this case. See #17609. --- src/osx/carbon/graphics.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index bc3ef2562e..27feca9780 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -1925,6 +1925,11 @@ void wxMacCoreGraphicsContext::GetClipBox(wxDouble* x, wxDouble* y, wxDouble* w, // wxFAIL_MSG( "Needs a valid context for clipping" ); #endif } + + if ( CGRectIsEmpty(r) ) + { + r = CGRectZero; + } CheckInvariants(); if ( x )