diff options
author | Matt Turner <mattst88@gmail.com> | 2012-03-28 13:09:42 -0400 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2012-03-29 18:36:45 -0400 |
commit | ddf8ae9731e546558b94151c6ecd3ca29ae55ea9 (patch) | |
tree | e0dd48081909ee05b3944bb0dec83817b0e5c1aa | |
parent | 4a51ddbba053ae5b864475de77f9a4511d70d73a (diff) |
Make Box.c:PreferredSize match libXaw
Fix up from 5d367cd9d0c. No functional changes.
Signed-off-by: Matt Turner <mattst88@gmail.com>
-rw-r--r-- | src/Box.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -351,15 +351,13 @@ PreferredSize(Widget widget, XtWidgetGeometry *constraint, XtWidgetGeometry *pre else { width = preferred_width; do { /* find some width big enough to stay within this height */ - if (width > constraint->width/2) { /* avoid short int overflow */ + if (width > (constraint->width >> 1)) /* avoid short int overflow */ width = constraint->width; - } - else { - width *= 2; - } + else + width <<= 1; DoLayout(w, width, 0, &preferred_width, &preferred_height, FALSE); - } while (preferred_height > constraint->height && - width < constraint->width); + } while (preferred_height > constraint->height + && width < constraint->width); if (width != constraint->width) { do { /* find minimum width */ width = preferred_width; |