max size + better scrolling size fn

This commit is contained in:
2025-11-21 02:44:59 -05:00
parent 172e7157be
commit 5785352ac0
7 changed files with 89 additions and 11 deletions

View File

@@ -184,12 +184,12 @@ impl<'a> PainterCtx<'a> {
// but this has a very weird issue where you can't move widgets unless u remove first
// so swapping is impossible rn I think?
// there's definitely better solutions like a counter (>1 = panic) but don't care rn
if self.draw_started.contains(&id) {
panic!(
"Cannot draw the same widget ({}) twice (1)",
self.widgets.data(&id).unwrap().label
);
}
// if self.draw_started.contains(&id) {
// panic!(
// "Cannot draw the same widget ({}) twice (1)",
// self.widgets.data(&id).unwrap().label
// );
// }
let mut old_children = old_children.unwrap_or_default();
let mut resize = ResizeRef::default();
if let Some(active) = self.active.get_mut(&id)
@@ -580,6 +580,10 @@ impl SizeCtx<'_> {
self.outer.to_abs(self.output_size)
}
pub fn output_size(&mut self) -> Vec2 {
self.output_size
}
pub fn draw_text(&mut self, buffer: &mut TextBuffer, attrs: &TextAttrs) -> TextTexture {
self.text.draw(buffer, attrs, self.textures)
}