X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/11e70ae6658f91558d03d346ec705efa8bac6800..ce7208d49d5ce2ca1dc0b3b83f14f1d04f29c4bf:/src/msw/notebook.cpp diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 9134dfc3e0..bfc98f9e01 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -911,6 +911,9 @@ void wxNotebook::OnPaint(wxPaintEvent& WXUNUSED(event)) wxBitmap bmp(rc.right, rc.bottom); memdc.SelectObject(bmp); + const wxLayoutDirection dir = dc.GetLayoutDirection(); + memdc.SetLayoutDirection(dir); + // if there is no special brush just use the solid background colour #if wxUSE_UXTHEME HBRUSH hbr = (HBRUSH)m_hbrBackground; @@ -928,7 +931,10 @@ void wxNotebook::OnPaint(wxPaintEvent& WXUNUSED(event)) MSWDefWindowProc(WM_PAINT, (WPARAM)memdc.GetHDC(), 0); - dc.Blit(0, 0, rc.right, rc.bottom, &memdc, 0, 0); + // For some reason in RTL mode, source offset has to be -1, otherwise the + // right border (physical) remains unpainted. + const wxCoord ofs = dir == wxLayout_RightToLeft ? -1 : 0; + dc.Blit(ofs, 0, rc.right, rc.bottom, &memdc, ofs, 0); } #endif // USE_NOTEBOOK_ANTIFLICKER