]> git.saurik.com Git - wxWidgets.git/commitdiff
Draw 2-pixel width rectangle ourselves, the
authorRobert Roebling <robert@roebling.de>
Mon, 18 Sep 2006 13:20:08 +0000 (13:20 +0000)
committerRobert Roebling <robert@roebling.de>
Mon, 18 Sep 2006 13:20:08 +0000 (13:20 +0000)
    X11 code leaves one pixel white (?) and
    looks differently positioned in RTL.

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

src/gtk/dcclient.cpp

index 068f5bc876c9454c1e5a2c7d16fe9998eeb257b7..71c58be3d2f69fd82f0b6ce034f6f67478cf9ab1 100644 (file)
@@ -838,7 +838,36 @@ void wxWindowDC::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord h
         }
 
         if (m_pen.GetStyle() != wxTRANSPARENT)
-            gdk_draw_rectangle( m_window, m_penGC, FALSE, xx, yy, ww-1, hh-1 );
+        {
+#if 1
+            if ((m_pen.GetWidth() == 2) && (m_pen.GetCap() == wxCAP_ROUND) &&
+                (m_pen.GetJoin() == wxJOIN_ROUND) && (m_pen.GetStyle() == wxSOLID))
+            {
+                // Use 2 1-line rects instead
+                gdk_gc_set_line_attributes( m_penGC, 1, GDK_LINE_SOLID, GDK_CAP_ROUND, GDK_JOIN_ROUND );
+
+                if (m_signX == -1)
+                {
+                    // Different for RTL
+                    gdk_draw_rectangle( m_window, m_penGC, FALSE, xx+1, yy, ww-2, hh-2 );
+                    gdk_draw_rectangle( m_window, m_penGC, FALSE, xx, yy-1, ww, hh );
+                }
+                else
+                {
+                    gdk_draw_rectangle( m_window, m_penGC, FALSE, xx, yy, ww-2, hh-2 );
+                    gdk_draw_rectangle( m_window, m_penGC, FALSE, xx-1, yy-1, ww, hh );
+                }
+                
+                // reset
+                gdk_gc_set_line_attributes( m_penGC, 2, GDK_LINE_SOLID, GDK_CAP_ROUND, GDK_JOIN_ROUND );
+            }
+            else
+#endif
+            {
+                // Just use X11 for other cases
+                gdk_draw_rectangle( m_window, m_penGC, FALSE, xx, yy, ww-1, hh-1 );
+            }
+        }
     }
 
     CalcBoundingBox( x, y );