fn paint_with_offset_impl(
        &mut self,
        ctx: &mut PaintCtx,
        data: &T,
        env: &Env,
        paint_if_not_visible: bool,
    ) {
        if !paint_if_not_visible && !ctx.region().intersects(self.state.paint_rect()) {
            return;
        }

        ctx.with_save(|ctx| {
            let layout_origin = self.layout_rect().origin().to_vec2();
            ctx.transform(Affine::translate(layout_origin));
            let visible = ctx.region().to_rect() - layout_origin;
            ctx.with_child_ctx(visible, |ctx| self.paint(ctx, data, env));
        });
    }
/// Shared implementation that can skip drawing non-visible content.
Shared implementation that can skip drawing non-visible content.
Shared implementation that can skip drawing non - visible content .
fn paint_with_offset_impl(
        &mut self,
        ctx: &mut PaintCtx,
        data: &T,
        env: &Env,
        paint_if_not_visible: bool,
    ) {
        if !paint_if_not_visible && !ctx.region().intersects(self.state.paint_rect()) {
            return;
        }
        ctx.with_save(|ctx| {
            let layout_origin = self.layout_rect().origin().to_vec2();
            ctx.transform(Affine::translate(layout_origin));
            let visible = ctx.region().to_rect() - layout_origin;
            ctx.with_child_ctx(visible, |ctx| self.paint(ctx, data, env));
        });
    }
fn paint_with_offset_impl ( & mut self , ctx : & mut PaintCtx , data : & T , env : & Env , paint_if_not_visible : bool , ) { if ! paint_if_not_visible && ! ctx . region ( ) . intersects ( self . state . paint_rect ( ) ) { return ; } ctx . with_save ( | ctx | { let layout_origin = self . layout_rect ( ) . origin ( ) . to_vec2 ( ) ; ctx . transform ( Affine :: translate ( layout_origin ) ) ; let visible = ctx . region ( ) . to_rect ( ) - layout_origin ; ctx . with_child_ctx ( visible , | ctx | self . paint ( ctx , data , env ) ) ; } ) ; }
Shared implementation that can skip drawing non-visible content.
Shared implementation that can skip drawing non - visible content .
&mut self
ctx
&mut PaintCtx
data
&T
env
&Env
paint_if_not_visible
bool