@@ -79,27 +79,23 @@ impl Container {
81 content: u32,
81 content: u32,
82− ) -> Vec<Node<'bump>>
82+ children: &mut bumpalo::collections::Vec<Node<'bump>>,
84 'a: 'bump,
84 'a: 'bump,
86 if s <= self.size {
86 if s <= self.size {
87− return vec![self.dot(bump, x, y, content)];
87+ children.push(self.dot(bump, x, y, content));
90 let s = s / 2.0;
91 let s = s / 2.0;
93− // Top of triangle
93+ // Top of triangle
94− self.triangle(bump, x, y - (s / 2.0), s, content),
94+ self.triangle(bump, x, y - (s / 2.0), s, content, children);
95− // Bottom-left of triangle
95+ // Bottom-left of triangle
96− self.triangle(bump, x - s, y + (s / 2.0), s, content),
96+ self.triangle(bump, x - s, y + (s / 2.0), s, content, children);
97− // Bottom-right of triangle
97+ // Bottom-right of triangle
98− self.triangle(bump, x + s, y + (s / 2.0), s, content),
98+ self.triangle(bump, x + s, y + (s / 2.0), s, content, children);
@@ -119,10 +115,13 @@ impl Render for Container {
120 let modulus = elapsed as u32 % 10;
116 let modulus = elapsed as u32 % 10;
118+ let mut children = bumpalo::collections::Vec::new_in(bump);
119+ self.triangle(bump, 0.0, 0.0, 1000.0, modulus, &mut children);
122 div(bump)
121 div(bump)
123 .attr("class", "container")
122 .attr("class", "container")
124 .attr("style", self.container_transform(bump, elapsed))
123 .attr("style", self.container_transform(bump, elapsed))
125− .children(self.triangle(bump, 0.0, 0.0, 1000.0, modulus))
124+ .children(children)
126 .finish()
125 .finish()