From 509a0a574a2aa343643dfea63eb154ea46c4ef7f Mon Sep 17 00:00:00 2001 From: Cory Forsstrom Date: Fri, 27 Sep 2024 08:58:33 -0700 Subject: Don't fill out of viewport text --- core/src/widget/text.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/src/widget') diff --git a/core/src/widget/text.rs b/core/src/widget/text.rs index 8b02f8c2..813b4be8 100644 --- a/core/src/widget/text.rs +++ b/core/src/widget/text.rs @@ -334,6 +334,10 @@ pub fn draw( { let bounds = layout.bounds(); + if !bounds.intersects(viewport) { + return; + } + let x = match paragraph.horizontal_alignment() { alignment::Horizontal::Left => bounds.x, alignment::Horizontal::Center => bounds.center_x(), -- cgit