Account for transformation in Text::visible_bounds
This commit is contained in:
parent
1e802e776c
commit
32cd456fb9
2 changed files with 7 additions and 5 deletions
|
|
@ -78,10 +78,12 @@ impl Text {
|
||||||
position,
|
position,
|
||||||
paragraph,
|
paragraph,
|
||||||
clip_bounds,
|
clip_bounds,
|
||||||
|
transformation,
|
||||||
..
|
..
|
||||||
} => (
|
} => (
|
||||||
Rectangle::new(*position, paragraph.min_bounds)
|
Rectangle::new(*position, paragraph.min_bounds)
|
||||||
.intersection(clip_bounds),
|
.intersection(clip_bounds)
|
||||||
|
.map(|bounds| bounds * *transformation),
|
||||||
Some(paragraph.horizontal_alignment),
|
Some(paragraph.horizontal_alignment),
|
||||||
Some(paragraph.vertical_alignment),
|
Some(paragraph.vertical_alignment),
|
||||||
),
|
),
|
||||||
|
|
@ -89,10 +91,12 @@ impl Text {
|
||||||
editor,
|
editor,
|
||||||
position,
|
position,
|
||||||
clip_bounds,
|
clip_bounds,
|
||||||
|
transformation,
|
||||||
..
|
..
|
||||||
} => (
|
} => (
|
||||||
Rectangle::new(*position, editor.bounds)
|
Rectangle::new(*position, editor.bounds)
|
||||||
.intersection(clip_bounds),
|
.intersection(clip_bounds)
|
||||||
|
.map(|bounds| bounds * *transformation),
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -200,9 +200,7 @@ impl Layer {
|
||||||
|text| {
|
|text| {
|
||||||
text.visible_bounds()
|
text.visible_bounds()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(|bounds| {
|
.map(|bounds| bounds * text_a.transformation())
|
||||||
bounds.intersection(&text_a.clip_bounds())
|
|
||||||
})
|
|
||||||
.collect()
|
.collect()
|
||||||
},
|
},
|
||||||
|text_a, text_b| text_a == text_b,
|
|text_a, text_b| text_a == text_b,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue