mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-04-06 00:32:05 +02:00
Fix 3D canvas blank area during window resize after wxWidgets 3.3.2 upgrade
This commit is contained in:
@@ -4739,11 +4739,19 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
||||
|
||||
void GLCanvas3D::on_paint(wxPaintEvent& evt)
|
||||
{
|
||||
if (m_initialized)
|
||||
if (m_initialized) {
|
||||
#ifdef __WXMSW__
|
||||
// Idle events are not dispatched during the Windows resize modal loop,
|
||||
// so render immediately to avoid blank frames.
|
||||
_refresh_if_shown_on_screen();
|
||||
m_dirty = false;
|
||||
#else
|
||||
m_dirty = true;
|
||||
else
|
||||
#endif
|
||||
} else {
|
||||
// Call render directly, so it gets initialized immediately, not from On Idle handler.
|
||||
this->render();
|
||||
}
|
||||
}
|
||||
|
||||
void GLCanvas3D::force_set_focus() {
|
||||
|
||||
@@ -428,7 +428,10 @@ wxGLCanvas* OpenGLManager::create_wxglcanvas(wxWindow& parent)
|
||||
if (! can_multisample())
|
||||
attribList[12] = 0;
|
||||
|
||||
return new wxGLCanvas(&parent, wxID_ANY, attribList, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS);
|
||||
wxGLCanvas* canvas = new wxGLCanvas(&parent, wxID_ANY, attribList, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS);
|
||||
// The GL canvas paints its entire surface, so background erasing is unnecessary.
|
||||
canvas->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
return canvas;
|
||||
}
|
||||
|
||||
void OpenGLManager::detect_multisample(int* attribList)
|
||||
|
||||
Reference in New Issue
Block a user