From 3ec4b5cc2291abb37f7f25d42ed3fdad623f0319 Mon Sep 17 00:00:00 2001 From: Eran Ifrah Date: Sun, 25 Oct 2015 18:01:25 +0100 Subject: [PATCH] Avoid fold margin corruption in wxStyledTextCtrl under MSW Don't use the content scale factor when creating bitmaps in InitPixMap(), this is wrong and results in badly sized bitmaps at least under MSW (and possibly GTK too). Closes #17069. --- src/stc/PlatWX.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 3e44e8db78..8c2576999e 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -257,8 +257,13 @@ void SurfaceImpl::InitPixMap(int width, int height, Surface *surface, WindowID w hdcOwned = true; if (width < 1) width = 1; if (height < 1) height = 1; +#ifdef __WXMSW__ + bitmap = new wxBitmap(width, height); + wxUnusedVar(winid); +#else bitmap = new wxBitmap(); bitmap->CreateScaled(width, height,wxBITMAP_SCREEN_DEPTH,((wxWindow*)winid)->GetContentScaleFactor()); +#endif ((wxMemoryDC*)hdc)->SelectObject(*bitmap); }