From 04a7a3f150e1518ba26b41ca620c73a20932f31d Mon Sep 17 00:00:00 2001 From: Andreas Falkenhahn Date: Sat, 5 Dec 2020 22:45:13 +0100 Subject: [PATCH] Fix drawing outside of the splitter sash under macOS Take into account the extra border when using wxSP_3DBORDER. Closes #18861. --- src/osx/carbon/renderer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/osx/carbon/renderer.cpp b/src/osx/carbon/renderer.cpp index 8d3fd41b54..a49daff549 100644 --- a/src/osx/carbon/renderer.cpp +++ b/src/osx/carbon/renderer.cpp @@ -348,11 +348,14 @@ void wxRendererMac::DrawSplitterSash( wxWindow *win, height = wxRendererNative::Get().GetSplitterParams(win).widthSash; + // Do not draw over border drawn by wxRendererGeneric::DrawSplitterBorder() + const wxCoord borderAdjust = win->HasFlag(wxSP_3DBORDER) ? 2 : 0; + HIRect splitterRect; if (orient == wxVERTICAL) - splitterRect = CGRectMake( position, 0, height, size.y ); + splitterRect = CGRectMake( position, borderAdjust, height, size.y - borderAdjust ); else - splitterRect = CGRectMake( 0, position, size.x, height ); + splitterRect = CGRectMake( borderAdjust, position, size.x - borderAdjust, height ); // under compositing we should only draw when called by the OS, otherwise just issue a redraw command // strange redraw errors occur if we don't do this