From f668f5b36ff36e40b50876b86171082c1cd791f4 Mon Sep 17 00:00:00 2001 From: Hartwig Date: Sun, 12 May 2019 21:46:44 +0200 Subject: [PATCH] Update wxImage used by Mac image graphics context in Flush() Calling Flush() is supposed to make everything drawn so far immediately visible, which means propagating it to the wxImage being drawn on in the case of image-based graphics context, but wxMacCoreGraphicsImageContext didn't do it, unlike Cairo and GDI+ version. Fix this by overriding Flush() in it to explicitly update m_image. Closes https://github.com/wxWidgets/wxWidgets/pull/1321 --- src/osx/carbon/graphics.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index 0fe428cd20..65fe9c63a3 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -2601,6 +2601,12 @@ public: m_image = m_bitmap.ConvertToImage(); } + virtual void Flush() wxOVERRIDE + { + wxMacCoreGraphicsContext::Flush(); + m_image = m_bitmap.ConvertToImage(); + } + private: wxImage& m_image; wxBitmap m_bitmap;