use crate::prelude::*;
#[derive(Declare)]
pub struct Void;
impl Render for Void {
fn perform_layout(&self, clamp: BoxClamp, ctx: &mut LayoutCtx) -> Size {
ctx
.perform_single_child_layout(clamp)
.unwrap_or(clamp.min)
}
fn paint(&self, _: &mut PaintingCtx) {}
fn hit_test(&self, _: &HitTestCtx, _: Point) -> HitTest {
HitTest { hit: false, can_hit_child: true }
}
}
impl<'c> ComposeChild<'c> for Void {
type Child = Widget<'c>;
fn compose_child(_: impl StateWriter<Value = Self>, child: Self::Child) -> Widget<'c> { child }
}