This commit is contained in:
iris committed 2025-08-24 22:44:21 -04:00
1 parent 880d7eca50
commit 9e751d4161
5 files changed
+11 -13

No files matched your search

+5 -4
View File
@@ -6,7 +6,7 @@ use crate::{
WidgetInstance, Widgets,
},
render::{Primitive, PrimitiveHandle, Primitives},
util::{HashMap, Id},
util::Id,
};
struct State {
@@ -26,7 +26,6 @@ pub struct Painter<'a, Ctx: 'static> {
pub(super) primitives: &'a mut Primitives,
textures: &'a mut Textures,
text: &'a mut TextData,
labels: &'a HashMap<Id, String>,
screen_size: Vec2,
/// state of what's currently being drawn
state: State,
@@ -43,7 +42,6 @@ impl<'a, Ctx> Painter<'a, Ctx> {
text: &'a mut TextData,
textures: &'a mut Textures,
screen_size: Vec2,
labels: &'a HashMap<Id, String>,
) -> Self {
Self {
widgets: nodes,
@@ -54,7 +52,6 @@ impl<'a, Ctx> Painter<'a, Ctx> {
text,
textures,
screen_size,
labels,
state: State {
region: UiRegion::full(),
children: Vec::new(),
@@ -165,6 +162,10 @@ impl<'a, Ctx> Painter<'a, Ctx> {
self.ctx
}
pub fn region_size(&self) -> Vec2 {
self.state.region.in_size(self.screen_size)
}
pub(crate) fn redraw(&mut self, id: &Id) {
if !self.active.widgets.contains_key(id) {
return;