uhh i'm not happy with this

This commit is contained in:
griffi-gh 2024-03-23 02:05:44 +01:00
parent 915b99c3a5
commit bbc1d9f1ff

View file

@ -7,6 +7,8 @@ use layer::{FrameLayer, RectLayer};
///XXX: this is not used yet, and also kinda a mess, simplify? ///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) ///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, ... ///aka Frame::Rectangle, Frame::NinePatch, ...
/// A frame, which can contain multiple layers /// A frame, which can contain multiple layers
@ -27,8 +29,14 @@ impl<T: Into<FillColor>> From<T> for Frame {
} }
impl Frame { impl Frame {
#[inline]
pub fn add(&mut self, layer: impl Into<FrameLayer>) -> &mut Self { pub fn add(&mut self, layer: impl Into<FrameLayer>) -> &mut Self {
self.layers.push(layer.into()); self.layers.push(layer.into());
self self
} }
#[inline]
pub fn finish(&mut self) -> Self {
self.clone()
}
} }