summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-05-03 14:59:31 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-05-03 14:59:31 +0000
commit9cc064677cc356e3bf1efe025de19fc59ad69154 (patch)
tree54a8d62adbfe17c17cfe6acdc6bf0f0b3c806576 /src
parent2f9a58d6084f4ba3fa16c5ca72c5a253d68f9ef8 (diff)
Add Albrecht's radio circle drawing fixes.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2188 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Light_Button.cxx13
-rw-r--r--src/Fl_Menu.cxx7
2 files changed, 11 insertions, 9 deletions
diff --git a/src/Fl_Light_Button.cxx b/src/Fl_Light_Button.cxx
index acf6cf658..a43f22ddc 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.16 2002/04/30 15:34:57 easysw Exp $"
+// "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.17 2002/05/03 14:59:31 easysw Exp $"
//
// Lighted button widget for the Fast Light Tool Kit (FLTK).
//
@@ -44,7 +44,7 @@ void Fl_Light_Button::draw() {
W = labelsize();
dx = Fl::box_dx(box()) + 2;
dy = (h() - W) / 2;
- if (dy < 0) dy = 0; // no negative values (?)
+ // if (dy < 0) dy = 0; // neg. offset o.k. for vertical centering
if (down_box()) {
// draw other down_box() styles:
@@ -70,9 +70,10 @@ 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()) - 2;
- int tdx = dx + Fl::box_dx(down_box()) + 1;
- int tdy = dy + Fl::box_dy(down_box()) + 1;
+ int tW = (W - Fl::box_dw(down_box())) / 2 + 1;
+ if ((W - tW) & 1) tW++; // Make sure difference is even to center
+ int tdx = dx + (W - tW) / 2;
+ int tdy = dy + (W - tW) / 2;
switch (tW) {
// Larger circles draw fine...
@@ -141,5 +142,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.16 2002/04/30 15:34:57 easysw Exp $".
+// End of "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.17 2002/05/03 14:59:31 easysw Exp $".
//
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index 7643c8b4e..9455fdb84 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.11 2002/04/30 15:34:58 easysw Exp $"
+// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.12 2002/05/03 14:59:31 easysw Exp $"
//
// Menu code for the Fast Light Tool Kit (FLTK).
//
@@ -166,7 +166,8 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m,
fl_draw_box(FL_ROUND_DOWN_BOX, x+2, y+d, W, W, FL_BACKGROUND2_COLOR);
if (value()) {
fl_color(labelcolor_);
- int tW = W - Fl::box_dw(FL_ROUND_DOWN_BOX) - 2;
+ int tW = (W - Fl::box_dw(FL_ROUND_DOWN_BOX)) / 2 + 1;
+ if ((W - tW) & 1) tW++; // Make sure difference is even to center
int td = Fl::box_dx(FL_ROUND_DOWN_BOX) + 1;
switch (tW) {
// Larger circles draw fine...
@@ -774,5 +775,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
}
//
-// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.11 2002/04/30 15:34:58 easysw Exp $".
+// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.12 2002/05/03 14:59:31 easysw Exp $".
//