+ lockedWidth := 0
+ lockedHeight := 0
+ lockedChildren := 0
+ for _, node := range s.children {
+ if n, ok := node.(*LeafNode); ok {
+ if s.kind == VerticalSplit {
+ if n.view.LockWidth {
+ lockedWidth += n.view.Width
+ lockedChildren++
+ }
+ } else {
+ if n.view.LockHeight {
+ lockedHeight += n.view.Height
+ lockedChildren++
+ }
+ }
+ } else if n, ok := node.(*SplitTree); ok {
+ if s.kind == VerticalSplit {
+ if n.lockWidth {
+ lockedWidth += n.width
+ lockedChildren++
+ }
+ } else {
+ if n.lockHeight {
+ lockedHeight += n.height
+ lockedChildren++
+ }
+ }
+ }
+ }
+ x, y := 0, 0
+ for _, node := range s.children {