sizing actually working correctly now

This commit is contained in:
iris committed 2025-09-16 17:31:54 -04:00
1 parent b48acccb8d
commit f9097807a2
17 files changed
+333 -194

No files matched your search

+3 -3
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()
}
}