]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmlcell.cpp
Improved selection mode handling in wxGrid::SelectBlock
[wxWidgets.git] / src / html / htmlcell.cpp
index 7b6eb3aacdacdd662c7862cbc95cdb08c4988c70..0ca4bb2524c06d500b7f2443386346e0f66ce4cb 100644 (file)
@@ -439,12 +439,14 @@ void wxHtmlContainerCell::Layout(int w)
                 int counter = 0;
                 int step = (s_width - xpos);
                 if (step < 0) step = 0;
-                while (line != cell) {
+                xcnt--;
+                if (xcnt > 0) while (line != cell) {
                     line -> SetPos(line -> GetPosX() + s_indent +
                                    (counter++ * step / xcnt),
                                    ypos + line -> GetPosY());
                     line = line -> GetNext();
                 }
+                xcnt++;
             }
 
             ypos += ysizedown;