MCPcopy Create free account
hub / github.com/Kethku/Pando / draw

Method draw

aspen/src/components/border.rs:77–93  ·  view source on GitHub ↗
(&self, cx: &mut DrawContext)

Source from the content-addressed store, hash-verified

75 }
76
77 fn draw(&self, cx: &mut DrawContext) {
78 let region = cx.region().to_rounded_rect(self.radius);
79 if self.background_separation > 0. {
80 cx.set_fill_brush(Brush::Solid(Color::new([0., 0., 0., 0.5])));
81 cx.blurred(
82 region + Vec2::new(0., self.background_separation),
83 self.background_separation * 2.,
84 );
85 }
86
87 cx.set_fill_brush(self.fill.clone());
88 cx.set_stroke_brush(self.stroke.clone());
89 cx.set_stroke_style(Stroke::new(self.thickness));
90 cx.stroked_fill(&region);
91
92 self.child.draw(cx);
93 }
94
95 fn children(&self) -> Vec<Token> {
96 self.child.tokens()

Callers

nothing calls this directly

Calls 6

regionMethod · 0.80
set_fill_brushMethod · 0.80
blurredMethod · 0.80
set_stroke_brushMethod · 0.80
set_stroke_styleMethod · 0.80
stroked_fillMethod · 0.80

Tested by

no test coverage detected