diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index e781bb9173..fe91c88fe5 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -1551,11 +1551,23 @@ wxBitmap* wxSimpleCheckBox::ms_doubleBuffer = NULL; void wxSimpleCheckBox::OnPaint( wxPaintEvent& WXUNUSED(event) ) { - wxSize clientSize = GetClientSize(); + wxRect rect(GetClientSize()); +#ifdef __WXMSW__ + wxPaintDC dc(this); + // Under MSW, wxAutoBufferedPaintDC, wxPaintDC don't work fine with RTL, + // so we need to bypass this problem by setting LTR direction for this DC. + // Fortunately, we have only check box image to draw, no texts. + if ( dc.GetLayoutDirection() == wxLayout_RightToLeft ) + { + dc.SetLayoutDirection(wxLayout_LeftToRight); + // Some hack to prevent shifting the ouput image. + rect.x -= 2; + } +#else wxAutoBufferedPaintDC dc(this); - +#endif dc.Clear(); - wxRect rect(0,0,clientSize.x,clientSize.y); + rect.y += 1; rect.width += 1;