From fc008c96c329ebbae7b03d8c4b6185e780b4d4af Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 16 Dec 2001 13:05:39 +0000 Subject: Update the radio button circle drawing code to take the boxtype borders into account. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1852 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Light_Button.cxx | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Fl_Light_Button.cxx b/src/Fl_Light_Button.cxx index 5d70e5fc8..d966f733d 100644 --- a/src/Fl_Light_Button.cxx +++ b/src/Fl_Light_Button.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.7 2001/11/28 21:37:35 easysw Exp $" +// "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.8 2001/12/16 13:05:39 easysw Exp $" // // Lighted button widget for the Fast Light Tool Kit (FLTK). // @@ -38,8 +38,17 @@ void Fl_Light_Button::draw() { if (box()) draw_box(this==Fl::pushed() ? down(box()) : box(), color()); Fl_Color col = value() ? (active_r() ? selection_color() : fl_inactive(selection_color())) : color(); - int W = labelsize() - 1; - int d = ((w() 12) { - fl_pie(x() + d + 4, y() + d + 5, W - 8, W - 8, 0.0, 360.0); + W -= Fl::box_dw(down_box()) + 3; + d += Fl::box_dx(down_box()) + 1; + if (W > 4) { + fl_pie(x() + d, y() + d, W, W + 1, 0.0, 360.0); } else { // Small circles don't draw well with some X servers... - fl_rectf(x() + d + 5, y() + d + 5, 2, 4); - fl_rectf(x() + d + 4, y() + d + 6, 4, 2); + fl_rectf(x() + d + 1, y() + d, 2, 4); + fl_rectf(x() + d, y() + d + 1, 4, 2); } } break; @@ -107,5 +118,5 @@ Fl_Light_Button::Fl_Light_Button(int x, int y, int w, int h, const char* l) } // -// End of "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.7 2001/11/28 21:37:35 easysw Exp $". +// End of "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.8 2001/12/16 13:05:39 easysw Exp $". // -- cgit v1.2.3