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

This commit is contained in:
2025-12-11 05:25:58 -05:00
parent 38266debb6
commit 2dc5b0f62c
76 changed files with 540 additions and 442 deletions

20
src/widget/mask.rs Normal file
View File

@@ -0,0 +1,20 @@
use crate::prelude::*;
pub struct Masked {
pub inner: WidgetId,
}
impl Widget for Masked {
fn draw(&mut self, painter: &mut Painter) {
painter.set_mask(painter.region());
painter.widget(&self.inner);
}
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)
}
}