From 9282371cb56c2cc19ebdfe15cf982aea17a72672 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Fri, 11 Oct 2002 17:03:47 +0000 Subject: [PATCH] Use 2.0 drawing code for check marks... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2674 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 2 ++ src/Fl_Light_Button.cxx | 18 +++++++++++------- src/Fl_Menu.cxx | 18 +++++++++++------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/CHANGES b/CHANGES index e7667b966..67b77199c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ CHANGES IN FLTK 1.1.1 + - Checkmarks didn't scale properly; copied the 2.0 check + mark code over. - Replaced several memcpy's with memmove's for portability (memmove allows for overlapping copies, memcpy does not) diff --git a/src/Fl_Light_Button.cxx b/src/Fl_Light_Button.cxx index 8bd5e67a0..e8979f1d5 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.20 2002/08/09 01:09:49 easysw Exp $" +// "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.21 2002/10/11 17:03:47 easysw Exp $" // // Lighted button widget for the Fast Light Tool Kit (FLTK). // @@ -57,11 +57,15 @@ void Fl_Light_Button::draw() { draw_box(down_box(), x()+dx, y()+dy, W, W, FL_BACKGROUND2_COLOR); if (value()) { fl_color(col); - int xu = x() + dx + W/3 + 1; - int yu = y() + dy + W - 4; - fl_line(xu - 2, yu - 2, xu, yu, xu + 5, yu - 5); - fl_line(xu - 2, yu - 3, xu, yu - 1, xu + 5, yu - 6); - fl_line(xu - 2, yu - 4, xu, yu - 2, xu + 5, yu - 7); + int tx = x() + dx + 3; + int tw = W - 6; + int d1 = tw/3; + int d2 = tw-d1; + int ty = y() + dy + (W+d2)/2-d1-2; + for (int n = 0; n < 3; n++, ty++) { + fl_line(tx, ty, tx+d1, ty+d1); + fl_line(tx+d1, ty+d1, tx+tw-1, ty+d1-d2+1); + } } break; case _FL_ROUND_DOWN_BOX : @@ -142,5 +146,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.20 2002/08/09 01:09:49 easysw Exp $". +// End of "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.21 2002/10/11 17:03:47 easysw Exp $". // diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index 2943ca096..e327224e4 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.18 2002/10/02 20:09:12 easysw Exp $" +// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.19 2002/10/11 17:03:47 easysw Exp $" // // Menu code for the Fast Light Tool Kit (FLTK). // @@ -199,11 +199,15 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m, fl_draw_box(FL_DOWN_BOX, x+2, y+d, W, W, FL_BACKGROUND2_COLOR); if (value()) { fl_color(labelcolor_); - int xu = x + W/3 + 3; - int yu = y + d + W - 4; - fl_line(xu - 2, yu - 2, xu, yu, xu + 5, yu - 5); - fl_line(xu - 2, yu - 3, xu, yu - 1, xu + 5, yu - 6); - fl_line(xu - 2, yu - 4, xu, yu - 2, xu + 5, yu - 7); + int tx = x + 5; + int tw = W - 6; + int d1 = tw/3; + int d2 = tw-d1; + int ty = y + d + (W+d2)/2-d1-2; + for (int n = 0; n < 3; n++, ty++) { + fl_line(tx, ty, tx+d1, ty+d1); + fl_line(tx+d1, ty+d1, tx+tw-1, ty+d1-d2+1); + } } } x += W + 3; @@ -776,5 +780,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const { } // -// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.18 2002/10/02 20:09:12 easysw Exp $". +// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.19 2002/10/11 17:03:47 easysw Exp $". //