cleanup elements #13

This commit is contained in:
2025-08-01 19:24:39 -05:00
parent bbff192788
commit 75827260cc
4 changed files with 29 additions and 90 deletions
+9 -9
View File
@@ -10,6 +10,15 @@ pub struct Div {
size: (u16, u16),
}
impl Div {
pub fn new() -> Self {
Div {
children: Mutex::new(Vec::new()),
size: (0, 0),
}
}
}
impl Element for Div {
fn render(&mut self, scope: &mut crate::render_scope::RenderScope) {
let (width, height) = scope.get_size_or(self.size.0, self.size.1);
@@ -59,12 +68,3 @@ impl Element for Div {
self
}
}
impl Div {
pub fn new() -> Self {
Div {
children: Mutex::new(Vec::new()),
size: (0, 0),
}
}
}