I forgot why I did it the other way lol (revert)

This commit is contained in:
2025-08-23 15:39:43 -04:00
parent 2ffb09bef0
commit abcbc267b5
7 changed files with 16 additions and 14 deletions

View File

@@ -60,20 +60,22 @@ impl<'a, Ctx> Painter<'a, Ctx> {
if self.sensors_map.get(&id.id).is_some() {
self.active_sensors.push((region, id.id.duplicate()));
}
self.nodes.get_dyn(id).draw(Painter {
nodes: self.nodes,
ctx: self.ctx,
sensors_map: self.sensors_map,
active_sensors: self.active_sensors,
primitives: self.primitives,
region,
});
// &mut self is passed to avoid copying all of the "static" pointers in self
// so need to save non static data here
let old = self.region;
self.region = region;
self.nodes.get_dyn(id).draw(self);
self.region = old;
}
pub fn draw_texture(&mut self, handle: &TextureHandle) {
self.write(handle.inner);
}
pub fn region(&self) -> UiRegion {
self.region
}
pub fn ctx(&mut self) -> &mut Ctx {
self.ctx
}