diff options
Diffstat (limited to 'src/Fl_Light_Button.cxx')
| -rw-r--r-- | src/Fl_Light_Button.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Fl_Light_Button.cxx b/src/Fl_Light_Button.cxx index 3044f802a..33ecbc116 100644 --- a/src/Fl_Light_Button.cxx +++ b/src/Fl_Light_Button.cxx @@ -33,13 +33,12 @@ void Fl_Light_Button::draw() { if (box()) draw_box(this==Fl::pushed() ? fl_down(box()) : box(), color()); Fl_Color col = value() ? (active_r() ? selection_color() : fl_inactive(selection_color())) : color(); - int W; - int dx, dy; - W = labelsize(); - dx = Fl::box_dx(box()) + 2; - dy = (h() - W) / 2; - // if (dy < 0) dy = 0; // neg. offset o.k. for vertical centering + int W = labelsize(); + int bx = Fl::box_dx(box()); // box frame width + int dx = bx + 2; // relative position of check mark etc. + int dy = (h() - W) / 2; // neg. offset o.k. for vertical centering + int lx = 0; // relative label position (STR #3237) if (down_box()) { // draw other down_box() styles: @@ -120,6 +119,7 @@ void Fl_Light_Button::draw() { draw_box(down_box(), x()+dx, y()+dy, W, W, col); break; } + lx = dx + W + 2; } else { // if down_box() is zero, draw light button style: int hh = h()-2*dy - 2; @@ -133,9 +133,9 @@ void Fl_Light_Button::draw() { } else { draw_box(FL_THIN_DOWN_BOX, x()+xx, y()+dy+1, ww, hh, col); } - dx = (ww + 2 * dx - W) / 2; + lx = dx + ww + 2; } - draw_label(x()+W+2*dx, y(), w()-W-2*dx, h()); + draw_label(x()+lx, y(), w()-lx-bx, h()); if (Fl::focus() == this) draw_focus(); } |
