summaryrefslogtreecommitdiff
path: root/grid.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-06-26 03:49:47 -0400
committerPietro Gagliardi <[email protected]>2014-06-26 03:49:47 -0400
commit1dd344b2f8a3e50e59cf3e0238f02fcf44707018 (patch)
tree4704465fd24af998866aee27b78dadd4db8c3dba /grid.go
parent2963b2217a1ae2ee7f6497a045ef5906c6dae6a9 (diff)
Fixed Space() causing panics during size calculations.
Diffstat (limited to 'grid.go')
-rw-r--r--grid.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/grid.go b/grid.go
index a298834..53c7d35 100644
--- a/grid.go
+++ b/grid.go
@@ -188,7 +188,11 @@ _=ymargin
if current != nil { // connect first left to first right
current.neighbor = c
}
- current = as[0] // next left is first subwidget
+ if len(as) != 0 {
+ current = as[0] // next left is first subwidget
+ } else {
+ current = nil // spaces don't have allocation data
+ }
allocations = append(allocations, as...)
x += g.colwidths[col]
}