mirror of
https://github.com/danbulant/cushy
synced 2026-06-14 20:11:04 +00:00
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:
parent
ffb1475e30
commit
48133cdac3
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue