refactor project structure (start of redoing atomic branch without atomics)

This commit is contained in:
iris committed 2025-12-11 05:25:58 -05:00
1 parent 38266debb6
commit 2dc5b0f62c
76 files changed
+540 -442

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
use crate::prelude::*;
pub struct Offset {
pub inner: WidgetId,
pub amt: UiVec2,
}
impl Widget for Offset {
fn draw(&mut self, painter: &mut Painter) {
let region = UiRegion::FULL.offset(self.amt);
painter.widget_within(&self.inner, region);
}
fn desired_width(&mut self, ctx: &mut SizeCtx) -> Len {
ctx.width(&self.inner)
}
fn desired_height(&mut self, ctx: &mut SizeCtx) -> Len {
ctx.height(&self.inner)
}
}