]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed clipping regression in wxAuiNotebook
authorBenjamin Williams <bwilliams@kirix.com>
Fri, 10 Nov 2006 13:47:06 +0000 (13:47 +0000)
committerBenjamin Williams <bwilliams@kirix.com>
Fri, 10 Nov 2006 13:47:06 +0000 (13:47 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/aui/auibook.cpp

index 84ed97b2b27d7f1ecd8cf2b44fd8f655140a9754..6aa541bfa9b4b8d8e974e666b291d4620e19180f 100644 (file)
@@ -389,13 +389,17 @@ void wxAuiDefaultTabArt::DrawTab(wxDC& dc,
     
     // create points that will make the tab outline
     
+    int clip_width = tab_width;
+    if (tab_x + clip_width > in_rect.x + in_rect.width)
+        clip_width = (in_rect.x + in_rect.width) - tab_x;
+        
     wxPoint clip_points[6];
-    clip_points[0] = wxPoint(tab_x,             tab_y+tab_height-3);
-    clip_points[1] = wxPoint(tab_x,             tab_y+2);
-    clip_points[2] = wxPoint(tab_x+2,           tab_y);
-    clip_points[3] = wxPoint(tab_x+tab_width-1, tab_y);
-    clip_points[4] = wxPoint(tab_x+tab_width+1, tab_y+2);
-    clip_points[5] = wxPoint(tab_x+tab_width+1, tab_y+tab_height-3);
+    clip_points[0] = wxPoint(tab_x,              tab_y+tab_height-3);
+    clip_points[1] = wxPoint(tab_x,              tab_y+2);
+    clip_points[2] = wxPoint(tab_x+2,            tab_y);
+    clip_points[3] = wxPoint(tab_x+clip_width-1, tab_y);
+    clip_points[4] = wxPoint(tab_x+clip_width+1, tab_y+2);
+    clip_points[5] = wxPoint(tab_x+clip_width+1, tab_y+tab_height-3);
 
     // set the clipping region for the tab --
     wxRegion clipping_region(6, clip_points);