From 15d92a2c74df7106ae8cf69e890a9a63fa9a9bc5 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Sat, 23 Mar 2024 02:05:44 +0100 Subject: [PATCH] uhh i'm not happy with this --- hui/src/frame.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hui/src/frame.rs b/hui/src/frame.rs index 7c4410a..e3ea565 100644 --- a/hui/src/frame.rs +++ b/hui/src/frame.rs @@ -7,6 +7,8 @@ use layer::{FrameLayer, RectLayer}; ///XXX: this is not used yet, and also kinda a mess, simplify? ///Maybe limit to a single layer? (aka `Frame` will be just one of the options) +///Because currently, this is just a duplicate of the dormal draw command system, but with a different name... +///Then, there's no need for the positioning stuff too, which is a bit overkill and is kinda code duplication too! ///aka Frame::Rectangle, Frame::NinePatch, ... /// A frame, which can contain multiple layers @@ -27,8 +29,14 @@ impl> From for Frame { } impl Frame { + #[inline] pub fn add(&mut self, layer: impl Into) -> &mut Self { self.layers.push(layer.into()); self } + + #[inline] + pub fn finish(&mut self) -> Self { + self.clone() + } }