Fixing an edge case in computing tab order

Removing widgets would affect the visual order, and sometimes nodes just
aren't available anymore. It might be that this should be cleaned up
more aggressively during widget removal, but by ignoring the removed
nodes, the code just becomes more resilliant to similar edge cases in
the future.
This commit is contained in:
Jonathan Johnson 2024-07-26 08:59:23 -07:00
parent ffb1475e30
commit 48133cdac3
No known key found for this signature in database
GPG key ID: A66D6A34D6620579

View file

@ -181,7 +181,7 @@ impl Tree {
let mut index = 0;
while index < unordered.len() {
let layout = match &data.nodes[unordered[index]].layout {
let layout = match data.nodes.get(unordered[index]).and_then(|n| n.layout) {
Some(layout) if layout.size.width > 0 && layout.size.height > 0 => layout,
_ => {
unordered.remove(index);