| ... | ... | @@ -153,10 +153,13 @@ impl Ui { |
| 153 | 153 | let mut nodes = Vec::new(); |
| 154 | 154 | let mut children = Vec::new(); |
| 155 | 155 | let mut seen = HashSet::from([Id::ROOT]); |
| 156 | | self.describe(0, scale, None, &mut children, &mut nodes, &mut seen); |
| 157 | 156 | let mut root = Node::new(Role::Window); |
| 158 | 157 | root.set_label(label); |
| 159 | | root.set_bounds(bounds(self.nodes[0].rect, scale)); |
| 158 | // Before the first frame is built, the window is all there is. |
| 159 | if let Some(built) = self.nodes.first() { |
| 160 | self.describe(0, scale, None, &mut children, &mut nodes, &mut seen); |
| 161 | root.set_bounds(bounds(built.rect, scale)); |
| 162 | } |
| 160 | 163 | root.set_children(children.into_iter().map(|(id, _)| id).collect::<Vec<_>>()); |
| 161 | 164 | nodes.push((Id::ROOT, root)); |
| 162 | 165 | let focus = self.focus.filter(|focus| seen.contains(focus)); |