From 32cd456fb936117307c178b4d47ae89124c8329a Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 10 Apr 2024 16:26:55 +0200 Subject: Account for `transformation` in `Text::visible_bounds` --- graphics/src/text.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'graphics') diff --git a/graphics/src/text.rs b/graphics/src/text.rs index 31b6de28..30269e69 100644 --- a/graphics/src/text.rs +++ b/graphics/src/text.rs @@ -78,10 +78,12 @@ impl Text { position, paragraph, clip_bounds, + transformation, .. } => ( Rectangle::new(*position, paragraph.min_bounds) - .intersection(clip_bounds), + .intersection(clip_bounds) + .map(|bounds| bounds * *transformation), Some(paragraph.horizontal_alignment), Some(paragraph.vertical_alignment), ), @@ -89,10 +91,12 @@ impl Text { editor, position, clip_bounds, + transformation, .. } => ( Rectangle::new(*position, editor.bounds) - .intersection(clip_bounds), + .intersection(clip_bounds) + .map(|bounds| bounds * *transformation), None, None, ), -- cgit