From 0625b9173518f13da3e0a30c9f4a79418dc14e69 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Wed, 17 Apr 2024 15:41:10 +0200 Subject: [PATCH] uhh stuff --- hui/src/element.rs | 4 ++-- hui/src/element/builtin/container.rs | 6 ++---- hui/src/element/builtin/fill_rect.rs | 11 ----------- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/hui/src/element.rs b/hui/src/element.rs index 59935a7..1d31f1d 100644 --- a/hui/src/element.rs +++ b/hui/src/element.rs @@ -17,8 +17,8 @@ pub use builtin::*; /// Context for the `Element::measure` function pub struct MeasureContext<'a> { - pub state: &'a StateRepo, pub layout: &'a LayoutInfo, + pub state: &'a StateRepo, pub text_measure: TextMeasure<'a>, pub current_font: FontHandle, pub images: ImageCtx<'a>, @@ -29,9 +29,9 @@ pub struct MeasureContext<'a> { /// Context for the `Element::process` function pub struct ProcessContext<'a> { pub measure: &'a Response, - pub state: &'a mut StateRepo, pub layout: &'a LayoutInfo, pub draw: &'a mut UiDrawCommandList, + pub state: &'a mut StateRepo, pub text_measure: TextMeasure<'a>, pub current_font: FontHandle, pub images: ImageCtx<'a>, diff --git a/hui/src/element/builtin/container.rs b/hui/src/element/builtin/container.rs index 6ca2a44..328f8c9 100644 --- a/hui/src/element/builtin/container.rs +++ b/hui/src/element/builtin/container.rs @@ -444,8 +444,8 @@ impl UiElement for Container { //measure let el_measure = element.measure(MeasureContext { - state: ctx.state, layout: &el_layout, + state: ctx.state, text_measure: ctx.text_measure, current_font: ctx.current_font, images: ctx.images, @@ -486,15 +486,13 @@ impl UiElement for Container { //process element.process(ProcessContext { measure: &el_measure, - state: ctx.state, layout: &el_layout, draw: ctx.draw, + state: ctx.state, text_measure: ctx.text_measure, current_font: ctx.current_font, images: ctx.images, input: ctx.input, - //HACK: i have no idea what to do with this - //this sucks signal: ctx.signal, }); diff --git a/hui/src/element/builtin/fill_rect.rs b/hui/src/element/builtin/fill_rect.rs index affcfec..1b056d7 100644 --- a/hui/src/element/builtin/fill_rect.rs +++ b/hui/src/element/builtin/fill_rect.rs @@ -57,17 +57,6 @@ impl UiElement for FillRect { } fn process(&self, ctx: ProcessContext) { - // if !self.background.is_transparent() { - // ctx.draw.add(UiDrawCommand::Rectangle { - // position: ctx.layout.position, - // size: ctx.measure.size, - // color: self.background.corners(), - // texture: None, - // rounded_corners: (self.corner_radius.max_f32() > 0.).then_some({ - // RoundedCorners::from_radius(self.corner_radius) - // }), - // }); - // } self.frame.draw(ctx.draw, ctx.layout.position, ctx.measure.size); } }