]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't force ColWidth to always grow for wxGridCellAutoWrapStringRenderer (#1798)
authorStefan Neis <Stefan.Neis@t-online.de>
Sun, 29 Jun 2008 15:14:42 +0000 (15:14 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Sun, 29 Jun 2008 15:14:42 +0000 (15:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54420 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/gridctrl.cpp

index 0d69504f6575d1917357d74718773fba23f7f300..e5ec58360f8a9c47c0015720c4da75fbd132cbb7 100644 (file)
@@ -378,7 +378,10 @@ wxGridCellAutoWrapStringRenderer::GetBestSize(wxGrid& grid,
                                               wxDC& dc,
                                               int row, int col)
 {
-    wxCoord x,y, height , width = grid.GetColSize(col) -10;
+    wxCoord x,y, height , width = grid.GetColSize(col) -20;
+    // for width, subtract 20 because ColSize includes a magin of 10 pixels
+    // that we do not want here and because we always start with an increment
+    // by 10 in the loop below.
     int count = 250; //Limit iterations..
 
     wxRect rect(0,0,width,10);