Fix T37847: some buttons displayed too wide in multi-column menus.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 18 Dec 2013 18:33:54 +0000 (19:33 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 18 Dec 2013 18:35:13 +0000 (19:35 +0100)
source/blender/editors/interface/interface.c

index 266b0637c27d87fc9e28bc3fb35a34f4d2b3da07..d09b3dea98a67f4de0d30f96e72edb6196122c59 100644 (file)
@@ -230,13 +230,7 @@ static void ui_text_bounds_block(uiBlock *block, float offset)
        /* cope with multi collumns */
        bt = block->buttons.first;
        while (bt) {
-               if (bt->next && bt->rect.xmin < bt->next->rect.xmin) {
-                       nextcol = 1;
-                       col++;
-               }
-               else {
-                       nextcol = 0;
-               }
+               nextcol = (bt->next && bt->rect.xmin < bt->next->rect.xmin);
                
                bt->rect.xmin = x1addval;
                bt->rect.xmax = bt->rect.xmin + i + block->bounds;
@@ -247,8 +241,10 @@ static void ui_text_bounds_block(uiBlock *block, float offset)
 
                ui_check_but(bt);  /* clips text again */
                
-               if (nextcol)
+               if (nextcol) {
                        x1addval += i + block->bounds;
+                       col++;
+               }
                
                bt = bt->next;
        }