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
This commit is contained in:
Hartwig
2019-05-12 21:46:44 +02:00
committed by Vadim Zeitlin
parent 04cebe381a
commit f668f5b36f

View File

@@ -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;