Skip to content

Commit

Permalink
Add Albrecht's radio circle drawing fixes.
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2188 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed May 3, 2002
1 parent 2f9a58d commit 9cc0646
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
8 changes: 5 additions & 3 deletions CHANGES
@@ -1,11 +1,13 @@
CHANGES IN FLTK 1.1.0rc2

- Adjusted the size of the circle that is drawn inside
radio buttons to scale better for larger labels.
- FLUID was opening the display when it shouldn't have.
- Fl_File_Chooser.cxx defined the file chooser functions
again; they should only be defined in the header file.
- Wide arcs would draw with "teeth".
- The preferences demo included Fl/Fl_Preferences.H
instead of FL/Fl_Preferences.H.
- Fl_File_Chooser.cxx defined the file chooser functions
again; they should only be defined in the header file.
- FLUID was opening the display when it shouldn't have.


CHANGES IN FLTK 1.1.0rc1
Expand Down
13 changes: 7 additions & 6 deletions 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).
//
Expand Down Expand Up @@ -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:
Expand All @@ -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...
Expand Down Expand Up @@ -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 $".
//
7 changes: 4 additions & 3 deletions 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).
//
Expand Down Expand Up @@ -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...
Expand Down Expand Up @@ -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 $".
//

0 comments on commit 9cc0646

Please sign in to comment.