diff options
| author | Matthias Melcher <github@matthiasm.com> | 2024-12-11 13:53:33 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2024-12-11 13:53:33 +0100 |
| commit | 34b5fe9e92a560d0507838c3dc1c6c3fd19648f9 (patch) | |
| tree | 1c79855da45ebca958b2d8499dd4ffbc86d3f704 /src/Fl_Button.cxx | |
| parent | 6784ae807cf327bc1026dd7efa0bf7f4dd501a06 (diff) | |
Fix drawing issue for checkbox buttons with bad box type (#1130)
Diffstat (limited to 'src/Fl_Button.cxx')
| -rw-r--r-- | src/Fl_Button.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Fl_Button.cxx b/src/Fl_Button.cxx index 308bb9bf3..5d40c37da 100644 --- a/src/Fl_Button.cxx +++ b/src/Fl_Button.cxx @@ -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; @@ -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 */ |
