From: Robert Roebling <robert@roebling.de>
Date: Tue, 14 Nov 2006 17:48:21 +0000 (+0000)
Subject:   The usual RTL fix for GTK+'s theme drawing function.
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/08f57d2125e7cf8b602fb7505d7c5dbbdd6b664c

  The usual RTL fix for GTK+'s theme drawing function.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43418 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/gtk/renderer.cpp b/src/gtk/renderer.cpp
index 77ce8a0a4f..e968ace5e1 100644
--- a/src/gtk/renderer.cpp
+++ b/src/gtk/renderer.cpp
@@ -510,6 +510,10 @@ wxRendererGTK::DrawItemSelectionRect(wxWindow *win,
     wxASSERT_MSG( gdk_window,
                   wxT("cannot use wxRendererNative on wxDC of this type") );
 
+    int x_diff = 0;
+    if (win->GetLayoutDirection() == wxLayout_RightToLeft)
+        x_diff = rect.width;
+
     GtkStateType state;
     if (flags & wxCONTROL_SELECTED)
     {
@@ -524,7 +528,7 @@ wxRendererGTK::DrawItemSelectionRect(wxWindow *win,
                         NULL,
                         win->m_wxwindow,
                         "cell_even",
-                        dc.LogicalToDeviceX(rect.x),
+                        dc.LogicalToDeviceX(rect.x) - x_diff,
                         dc.LogicalToDeviceY(rect.y),
                         rect.width,
                         rect.height );