Account for transformation in Text::visible_bounds

This commit is contained in:
Héctor Ramón Jiménez 2024-04-10 16:26:55 +02:00
parent 1e802e776c
commit 32cd456fb9
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 7 additions and 5 deletions

View file

@ -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,
),