1
0
Fork 0
forked from wry/wry

render: bound async title textures to their rect

This commit is contained in:
Julian Orth 2025-02-19 19:34:28 +01:00
parent 5932ec14a7
commit f80ac20220
3 changed files with 16 additions and 18 deletions

View file

@ -92,8 +92,7 @@ pub enum ContainerFocus {
tree_id!(ContainerNodeId);
pub struct ContainerTitle {
pub x: i32,
pub y: i32,
pub rect: Rect,
pub tex: Rc<dyn GfxTexture>,
}
@ -765,11 +764,7 @@ impl ContainerNode {
}
if let Some(tex) = tex.texture() {
let titles = rd.titles.get_or_default_mut(*scale);
titles.push(ContainerTitle {
x: rect.x1(),
y: rect.y1(),
tex,
})
titles.push(ContainerTitle { rect, tex })
}
}
}
@ -840,11 +835,7 @@ impl ContainerNode {
for (scale, tex) in tt {
if let Some(tex) = tex.texture() {
let titles = rd.titles.get_or_default_mut(*scale);
titles.push(ContainerTitle {
x: rect.x1(),
y: rect.y1(),
tex,
})
titles.push(ContainerTitle { rect, tex })
}
}
}