slightly improved structure and added a few more elements

This commit is contained in:
2025-06-27 12:10:25 -05:00
parent dfb17ab48e
commit 15b61d57c8
11 changed files with 242 additions and 14 deletions
+20
View File
@@ -0,0 +1,20 @@
use crate::Element;
pub struct Rect(pub u32);
impl Element for Rect {
fn render(&mut self, scope: &mut crate::render_scope::RenderScope) {
let (w, h) = scope.get_size();
if w > 0 && h > 0 {
scope.draw_rect(w, h, self.0);
}
}
fn as_any_mut(&mut self) -> &mut dyn std::any::Any {
self
}
fn as_any(&self) -> &dyn std::any::Any {
self
}
}