diff options
| author | Matthias Melcher <github@matthiasm.com> | 2024-12-16 20:30:31 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2024-12-16 20:30:46 +0100 |
| commit | 3293a68c1dd232e5d9b659bfe9882c647d727a77 (patch) | |
| tree | 2221812646b908587c96507552a0b47b93f7267c | |
| parent | c083e5c5fb7140cdbbeef1adb1e808611d46596e (diff) | |
Fix possibly uncleared damage flag of Fl_Pack (#1172).
Damage flag `FL_DAMAGE_ALL` is set during Fl_Pack::draw if child
is repositioned. If the child is outside the clipping area, if will not redraw
and the flag will remain set even after Fl_Pack::draw which is not allowed.
| -rw-r--r-- | src/Fl_Pack.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Fl_Pack.cxx b/src/Fl_Pack.cxx index dc6a4758b..bbc5c2434 100644 --- a/src/Fl_Pack.cxx +++ b/src/Fl_Pack.cxx @@ -110,12 +110,18 @@ void Fl_Pack::draw() { } if (X != o->x() || Y != o->y() || W != o->w() || H != o->h()) { o->resize(X,Y,W,H); + // Clear all damage flags, but *set* FL_DAMAGE_ALL, even if the widget + // may be clipped by the parent and needs no redraw. o->clear_damage(FL_DAMAGE_ALL); } if (d&FL_DAMAGE_ALL) { draw_child(*o); draw_outside_label(*o); - } else update_child(*o); + } else { + update_child(*o); + } + // Make sure that all damage flags are cleared. + o->clear_damage(); // child's draw() can change it's size, so use new size: current_position += (horizontal() ? o->w() : o->h()); if (current_position > maximum_position) |
