Skip to content

Commit

Permalink
Fix drawing issue for checkbox buttons with bad box type (fltk#1130)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasWM committed Dec 11, 2024
1 parent 6784ae8 commit 34b5fe9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Fl_Button.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ int Fl_Button::handle(int event) {
if (newval != value_) {
value_ = newval;
set_changed();
redraw();
if (box() && (fl_box(box())==box())) redraw();
else redraw_label();
if (when() & FL_WHEN_CHANGED) do_callback(FL_REASON_CHANGED);
}
return 1;
Expand Down Expand Up @@ -163,7 +164,10 @@ int Fl_Button::handle(int event) {
int X = x() > 0 ? x() - 1 : 0;
int Y = y() > 0 ? y() - 1 : 0;
if (window()) window()->damage(FL_DAMAGE_ALL, X, Y, w() + 2, h() + 2);
} else redraw();
} else {
if (box() && (fl_box(box())==box())) redraw();
else redraw_label();
}
return 1;
} else return 0;
/* NOTREACHED */
Expand Down

0 comments on commit 34b5fe9

Please sign in to comment.