MCPcopy Create free account
hub / github.com/audulus/rui / draw

Method draw

src/views/stack.rs:66–94  ·  view source on GitHub ↗
(&self, path: &mut IdPath, args: &mut DrawArgs)

Source from the content-addressed store, hash-verified

64 }
65
66 fn draw(&self, path: &mut IdPath, args: &mut DrawArgs) {
67 let mut c = 0;
68 self.children.foreach_view(&mut |child| {
69 path.push(c);
70 let layout_box = args.cx.get_layout(path);
71
72 args.vger.save();
73
74 args.vger.translate(layout_box.offset);
75
76 (*child).draw(path, args);
77 c += 1;
78
79 if DEBUG_LAYOUT {
80 let paint = args.vger.color_paint(CONTROL_BACKGROUND);
81 args.vger.stroke_rect(
82 layout_box.rect.min(),
83 layout_box.rect.max(),
84 0.0,
85 1.0,
86 paint,
87 );
88 }
89
90 path.pop();
91
92 args.vger.restore();
93 })
94 }
95
96 fn layout(&self, path: &mut IdPath, args: &mut LayoutArgs) -> LocalSize {
97 let n = self.children.len() as f32;

Callers

nothing calls this directly

Calls 1

get_layoutMethod · 0.80

Tested by

no test coverage detected