mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-25 08:28:42 -06:00
uhh stuff
This commit is contained in:
parent
cdaf4c0781
commit
7b671d2f3d
|
@ -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>,
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue