# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1323381482 0 # Node ID 02a329b2b0cd45e5520f56549a543053cce5f2bf # Parent b9577d1f0411b6180af653b0f5191203695e2f1a Added groupbox perfomance improvement to Windows and OS/2 that was missed when importing from the Mac. Only calculate the groupbox border size on the first pass. diff -r b9577d1f0411 -r 02a329b2b0cd mac/dw.m --- a/mac/dw.m Thu Dec 08 11:43:28 2011 +0000 +++ b/mac/dw.m Thu Dec 08 21:58:02 2011 +0000 @@ -2428,7 +2428,7 @@ if(thisbox->grouphwnd) { /* Only calculate the size on the first pass... - * used the cached values on second. + * use the cached values on second. */ if(pass == 1) { diff -r b9577d1f0411 -r 02a329b2b0cd os2/dw.c --- a/os2/dw.c Thu Dec 08 11:43:28 2011 +0000 +++ b/os2/dw.c Thu Dec 08 21:58:02 2011 +0000 @@ -1075,29 +1075,35 @@ if(thisbox->grouphwnd) { - char *text = dw_window_get_text(thisbox->grouphwnd); - - thisbox->grouppady = 9; - - if(text) - { - if(*text) - dw_font_text_extents_get(thisbox->grouphwnd, 0, text, NULL, &thisbox->grouppady); - dw_free(text); - } - /* If the string height is less than 9... - * set it to 9 anyway since that is the minimum. + /* Only calculate the size on the first pass... + * use the cached values on second. */ - if(thisbox->grouppady < 9) + if(pass == 1) + { + char *text = dw_window_get_text(thisbox->grouphwnd); + thisbox->grouppady = 9; - if(thisbox->grouppady) - thisbox->grouppady += 3; - else - thisbox->grouppady = 6; - - thisbox->grouppadx = 6; - + if(text) + { + if(*text) + dw_font_text_extents_get(thisbox->grouphwnd, 0, text, NULL, &thisbox->grouppady); + dw_free(text); + } + /* If the string height is less than 9... + * set it to 9 anyway since that is the minimum. + */ + if(thisbox->grouppady < 9) + thisbox->grouppady = 9; + + if(thisbox->grouppady) + thisbox->grouppady += 3; + else + thisbox->grouppady = 6; + + thisbox->grouppadx = 6; + } + thisbox->minwidth += thisbox->grouppadx; thisbox->usedpadx += thisbox->grouppadx; thisbox->minheight += thisbox->grouppady; diff -r b9577d1f0411 -r 02a329b2b0cd win/dw.c --- a/win/dw.c Thu Dec 08 11:43:28 2011 +0000 +++ b/win/dw.c Thu Dec 08 21:58:02 2011 +0000 @@ -1142,28 +1142,34 @@ if(thisbox->grouphwnd) { - char *text = dw_window_get_text(thisbox->grouphwnd); - - thisbox->grouppady = 9; - - if(text) - { - if(*text) - dw_font_text_extents_get(thisbox->grouphwnd, 0, text, NULL, &thisbox->grouppady); - dw_free(text); - } - /* If the string height is less than 9... - * set it to 9 anyway since that is the minimum. + /* Only calculate the size on the first pass... + * use the cached values on second. */ - if(thisbox->grouppady < 9) + if(pass == 1) + { + char *text = dw_window_get_text(thisbox->grouphwnd); + thisbox->grouppady = 9; + + if(text) + { + if(*text) + dw_font_text_extents_get(thisbox->grouphwnd, 0, text, NULL, &thisbox->grouppady); + dw_free(text); + } + /* If the string height is less than 9... + * set it to 9 anyway since that is the minimum. + */ + if(thisbox->grouppady < 9) + thisbox->grouppady = 9; - if(thisbox->grouppady) - thisbox->grouppady += 3; - else - thisbox->grouppady = 6; - - thisbox->grouppadx = 6; + if(thisbox->grouppady) + thisbox->grouppady += 3; + else + thisbox->grouppady = 6; + + thisbox->grouppadx = 6; + } thisbox->minwidth += thisbox->grouppadx; thisbox->usedpadx += thisbox->grouppadx;