Cull out of bounds rich_text during draw

This commit is contained in:
Héctor Ramón Jiménez 2025-02-01 01:07:03 +01:00
parent 7336a18443
commit c2155b82b3
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -239,6 +239,10 @@ where
cursor: mouse::Cursor, cursor: mouse::Cursor,
viewport: &Rectangle, viewport: &Rectangle,
) { ) {
if !layout.bounds().intersects(viewport) {
return;
}
let state = tree let state = tree
.state .state
.downcast_ref::<State<Link, Renderer::Paragraph>>(); .downcast_ref::<State<Link, Renderer::Paragraph>>();