Simple experimental low-level UI library written in C++
Find a file
hippoz 94c0be051b
Add "invalidation rectangle"-based repainting
Previously, we were repainting each widget as repainting was needed.
However, this created issues with clipping, since the widgets were not
aware of their parent's clips. It also created many other issues, including
performance problems and the lack of support for overlapping widgets.

This commit improves repainting behavior by adopting a painting model similar
to the one found in SerenityOS's LibGUI. It uses "damage rectangles", which
are translated to the widget coordinate space as needed, since the position of
widgets is relative to their parent's origin.
When a widget needs to be repainted, a repaint event with the damage
rectangle equal to the widget's current geometry translated to the window's coordinate
space is dispatched to the main widget. It will recursively follow the widget tree.
Widgets fully contain their children, thus widgets not contained by the damage
rectangle will reject the event, ensuring repainting is only done where needed.
Relayouting is done on a per-subtree basis only.

This commit should pave the way for things like scrolling
and overlapping widgets.
2022-06-10 19:42:03 +03:00
src Add "invalidation rectangle"-based repainting 2022-06-10 19:42:03 +03:00
.gitignore add an property to widgets to make them omit layout... 2022-05-14 15:44:05 +03:00
LICENSE Add 'LICENSE' 2021-12-19 16:27:55 +00:00
meson.build Move logic from Layout into DocumentLayout 2022-04-03 13:25:09 +03:00