summaryrefslogtreecommitdiff
path: root/src/Fl_Menu.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2005-03-05 19:53:43 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2005-03-05 19:53:43 +0000
commita48c6dd545b385bd7d5f92fee662647b87d93d1c (patch)
tree103c46c8304fef6fb089712426445b530e951c3a /src/Fl_Menu.cxx
parent2c989c8e4c82cbae150f51bba31e9728c4dbd66a (diff)
Fixed menu item width calculations with symbols (STR #740)
src/Fl_Menu.cxx: - Fl_Menu_Item::measure() - initialize w and h to label font size so that the symbol size is calculated properly. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4066 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Menu.cxx')
-rw-r--r--src/Fl_Menu.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index 20bf39ab8..61e0dd98f 100644
--- a/src/Fl_Menu.cxx
+++ b/src/Fl_Menu.cxx
@@ -122,7 +122,9 @@ int Fl_Menu_Item::measure(int* hp, const Fl_Menu_* m) const {
l.size = labelsize_ ? labelsize_ : m ? m->textsize() : (uchar)FL_NORMAL_SIZE;
l.color = FL_BLACK; // this makes no difference?
fl_draw_shortcut = 1;
- int w = 0; int h = 0; l.measure(w, hp ? *hp : h);
+ int w = l.size; int h = l.size;
+ if (hp) *hp = h;
+ l.measure(w, hp ? *hp : h);
fl_draw_shortcut = 0;
if (flags & (FL_MENU_TOGGLE|FL_MENU_RADIO)) w += 14;
return w;