store size in tex instead of bot_right

This commit is contained in:
2025-11-21 14:38:16 -05:00
parent c428de8fd5
commit 97b284e81e
5 changed files with 34 additions and 17 deletions

View File

@@ -16,7 +16,7 @@ pub struct TextEdit {
impl TextEdit {
pub fn region(&self) -> UiRegion {
self.tex()
.map(|t| t.size())
.map(|t| t.size)
.unwrap_or(Vec2::ZERO)
.align(self.align)
}
@@ -49,11 +49,11 @@ impl Widget for TextEdit {
}
fn desired_width(&mut self, ctx: &mut SizeCtx) -> Len {
Len::abs(self.view.draw(ctx).size().x)
Len::abs(self.view.draw(ctx).size.x)
}
fn desired_height(&mut self, ctx: &mut SizeCtx) -> Len {
Len::abs(self.view.draw(ctx).size().y)
Len::abs(self.view.draw(ctx).size.y)
}
}