If I enable wxGraphicsContext then the background is not cleared using SetCanvasColour, it is only cleared with a gradient background.
I think this is because of the following lines in wxSFShapeCanvas::DrawContent:
If I change them to:
wxSize nBcgSize = GetVirtualSize() + wxSize(m_Settings.m_nGridSize.x, m_Settings.m_nGridSize.y);
if( m_Settings.m_nScale != 1.f )
dc.DrawRectangle(wxRect(wxPoint(0, 0), wxSize( nBcgSize.x/m_Settings.m_nScale, nBcgSize.y/m_Settings.m_nScale)));
dc.DrawRectangle(wxRect(wxPoint(0, 0), GetVirtualSize() + wxSize(m_Settings.m_nGridSize.x, m_Settings.m_nGridSize.y)));
Then it works, but I am not sure if this is the best way?
Hmmm, It works for me at least with the latest trunk (rev 418), wxWidgets 2.9.5 and integrated Intel graphics (Ubuntu 12.04.2 LTS). Please, could you test whether the lates changes in wxSF trunk fixed the issue?
Sorry I should have mentioned that I am using Windows 8.
I tested on Ubuntu 13.04 and it works fine, but I still see the problem on Windows 8.
The best way to reproduce the problem is to change the lines around 32 - 40 in wxSFDemo as follows:
// the canvas background can be filled with a solid colour ...
// ... or by a gradient fill
Place a rectangle object in the lower right corner and then start zooming in.
Which wxWidgets version do you use? wxGraphicsContext's implementation differs between 2.8 and 2.9 a lot so wxSF must implement many things differently as well... :(
I have upped version to 2.9.5 for this test