use crate::prelude::*;
#[derive(SingleChild, Query, Declare)]
pub struct Void;
impl Render for Void {
fn perform_layout(&self, clamp: BoxClamp, ctx: &mut LayoutCtx) -> Size {
ctx
.single_child_layouter()
.map_or_else(Size::zero, |mut l| l.perform_widget_layout(clamp))
}
fn paint(&self, _: &mut PaintingCtx) {}
fn hit_test(&self, _: &HitTestCtx, _: Point) -> HitTest {
HitTest { hit: false, can_hit_child: true }
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::test_helper::*;
use ribir_dev_helper::*;
extern crate test;
use test::Bencher;
fn base() -> impl WidgetBuilder { fn_widget!(Void) }
widget_bench!(base);
}