Introduce a visible_bounds parameter to Element::paint

We're not using this yet but this will be useful to avoid rendering
unnecessary portions of text.
This commit is contained in:
Antonio Scandurra
2021-09-02 11:42:23 +02:00
parent 38dc023942
commit 0490c609fb
21 changed files with 94 additions and 42 deletions
+2 -1
View File
@@ -169,6 +169,7 @@ impl Element for Container {
fn paint(
&mut self,
bounds: RectF,
visible_bounds: RectF,
_: &mut Self::LayoutState,
cx: &mut PaintContext,
) -> Self::PaintState {
@@ -198,7 +199,7 @@ impl Element for Container {
self.style.border.left_width(),
self.style.border.top_width(),
);
self.child.paint(child_origin, cx);
self.child.paint(child_origin, visible_bounds, cx);
}
fn dispatch_event(