From 7cd4e343a2db73801babd9437b70d664bea60c6f Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 20 Apr 2022 21:58:20 +0200 Subject: [PATCH] Let wxGCDC inherit wxWindow from wxGraphicsContext --- src/common/dcgraph.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index 13eb330aa1..0255b5de68 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -160,6 +160,11 @@ void wxGCDCImpl::SetGraphicsContext( wxGraphicsContext* ctx ) if ( DoInitContext(ctx) ) { + if (m_graphicContext->GetWindow()) + { + m_window = m_graphicContext->GetWindow(); + } + // Reapply our attributes to the context. m_graphicContext->SetFont( m_font , m_textForegroundColour ); m_graphicContext->SetPen( m_pen );