update px dependent on resize + move painter data into struct in ui

This commit is contained in:
2025-09-28 13:14:51 -04:00
parent 61df088cc7
commit c98a43f94d
7 changed files with 99 additions and 105 deletions

View File

@@ -59,11 +59,11 @@ impl UiRenderer {
pub fn update(&mut self, device: &Device, queue: &Queue, ui: &mut Ui) {
self.active.clear();
for (i, ulayer) in ui.layers.iter_mut() {
for (i, ulayer) in ui.data.layers.iter_mut() {
self.active.push(i);
let primitives = &mut ulayer.primitives;
for change in primitives.apply_free() {
if let Some(inst) = ui.active.get_mut(&change.id) {
if let Some(inst) = ui.data.active.get_mut(&change.id) {
for h in &mut inst.primitives {
if h.inst_idx == change.old {
h.inst_idx = change.new;
@@ -98,7 +98,7 @@ impl UiRenderer {
)
}
}
if self.textures.update(&mut ui.textures) {
if self.textures.update(&mut ui.data.textures) {
self.rsc_group = Self::rsc_group(device, &self.rsc_layout, &self.textures)
}
}