sizing actually working correctly now

This commit is contained in:
2025-09-16 17:31:54 -04:00
parent b48acccb8d
commit f9097807a2
17 changed files with 333 additions and 194 deletions

View File

@@ -1,11 +1,11 @@
use crate::layout::{Painter, SizeCtx, StaticWidgetId, Ui, Vec2, WidgetId, WidgetIdFn};
use crate::layout::{Painter, SizeCtx, StaticWidgetId, Ui, UiVec2, WidgetId, WidgetIdFn};
use std::{any::Any, marker::PhantomData};
pub trait Widget: Any {
fn draw(&mut self, painter: &mut Painter);
fn get_size(&mut self, ctx: &mut SizeCtx) -> Vec2 {
ctx.size
fn desired_size(&mut self, _: &mut SizeCtx) -> UiVec2 {
UiVec2::max_size()
}
}