diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-04-30 15:34:58 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-04-30 15:34:58 +0000 |
| commit | 19b4d2fd1cb060a83ed75353f876dec3877059a5 (patch) | |
| tree | e44b2560e039efb795f87765f939c46160994e65 /src/Fl_Light_Button.cxx | |
| parent | 2779ff9099ed5b2805d1e8d247594d4b019eed05 (diff) | |
Fix radio button drawing for menubars and light buttons. Basically,
don't use system-supplied circle drawing functions, since they don't
do a good job with small circles.
Add !__CYGWIN__ for use of WIN32 mkdir() function in preferences...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2140 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Light_Button.cxx')
| -rw-r--r-- | src/Fl_Light_Button.cxx | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/src/Fl_Light_Button.cxx b/src/Fl_Light_Button.cxx index 986cbe8d0..acf6cf658 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.15 2002/04/29 19:27:51 easysw Exp $" +// "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.16 2002/04/30 15:34:57 easysw Exp $" // // Lighted button widget for the Fast Light Tool Kit (FLTK). // @@ -70,16 +70,34 @@ void Fl_Light_Button::draw() { draw_box(down_box(), x()+dx, y()+dy, W, W, FL_BACKGROUND2_COLOR); if (value()) { fl_color(col); - int tW = W - Fl::box_dw(down_box()) - 3; + int tW = W - Fl::box_dw(down_box()) - 2; int tdx = dx + Fl::box_dx(down_box()) + 1; int tdy = dy + Fl::box_dy(down_box()) + 1; - if (tW > 4) { - fl_pie(x() + tdx, y() + tdy, tW, tW , 0.0, 360.0); - } else { - // Small circles don't draw well with some X servers... - fl_rectf(x() + tdx + 1, y() + tdy, 2, 4); - fl_rectf(x() + tdx, y() + tdy + 1, 4, 2); + switch (tW) { + // Larger circles draw fine... + default : + fl_pie(x() + tdx, y() + tdy, tW, tW, 0.0, 360.0); + break; + + // Small circles don't draw well on many systems... + case 6 : + fl_rectf(x() + tdx + 2, y() + tdy, tW - 4, tW); + fl_rectf(x() + tdx + 1, y() + tdy + 1, tW - 2, tW - 2); + fl_rectf(x() + tdx, y() + tdy + 2, tW, tW - 4); + break; + + case 5 : + case 4 : + case 3 : + fl_rectf(x() + tdx + 1, y() + tdy, tW - 2, tW); + fl_rectf(x() + tdx, y() + tdy + 1, tW, tW - 2); + break; + + case 2 : + case 1 : + fl_rectf(x() + tdx, y() + tdy, tW, tW); + break; } } break; @@ -123,5 +141,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.15 2002/04/29 19:27:51 easysw Exp $". +// End of "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.16 2002/04/30 15:34:57 easysw Exp $". // |
