Sort damage by distance from origin in iced_graphics::damage
This commit is contained in:
parent
fdd9896dc5
commit
1e8554bf02
2 changed files with 12 additions and 13 deletions
|
|
@ -213,16 +213,14 @@ impl Layer {
|
|||
¤t.primitives,
|
||||
|item| match item {
|
||||
Item::Live(primitive) => vec![primitive.visible_bounds()],
|
||||
Item::Group(primitives, bounds, transformation) => {
|
||||
damage::group(
|
||||
primitives
|
||||
.as_slice()
|
||||
.iter()
|
||||
.map(Primitive::visible_bounds)
|
||||
.map(|bounds| bounds * *transformation)
|
||||
.collect(),
|
||||
*bounds,
|
||||
)
|
||||
Item::Group(primitives, group_bounds, transformation) => {
|
||||
primitives
|
||||
.as_slice()
|
||||
.iter()
|
||||
.map(Primitive::visible_bounds)
|
||||
.map(|bounds| bounds * *transformation)
|
||||
.filter_map(|bounds| bounds.intersection(group_bounds))
|
||||
.collect()
|
||||
}
|
||||
Item::Cached(_, bounds, _) => {
|
||||
vec![*bounds]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue