summaryrefslogtreecommitdiff
path: root/grid.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-17 21:09:03 -0400
committerPietro Gagliardi <[email protected]>2014-03-17 21:09:03 -0400
commit64d5eb541eb28e1a7e81adca66a72155d16033b4 (patch)
tree7db7c7ee787afc02823833340c3a2d0068807117 /grid.go
parentc1807033733654db480e782acebdccda9eababc6 (diff)
Changed the new resizing code so that it uses the same allocated slice per window instead of making a new one to store all the resize requests each time.
Diffstat (limited to 'grid.go')
-rw-r--r--grid.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/grid.go b/grid.go
index 064dcab..c38ecf4 100644
--- a/grid.go
+++ b/grid.go
@@ -120,7 +120,7 @@ func (g *Grid) make(window *sysData) error {
return nil
}
-func (g *Grid) setRect(x int, y int, width int, height int) (rr []resizerequest) {
+func (g *Grid) setRect(x int, y int, width int, height int, rr *[]resizerequest) {
max := func(a int, b int) int {
if a > b {
return a
@@ -171,13 +171,13 @@ func (g *Grid) setRect(x int, y int, width int, height int) (rr []resizerequest)
w = g.colwidths[col]
h = g.rowheights[row]
}
- rr = append(rr, c.setRect(x, y, w, h)...)
+ c.setRect(x, y, w, h, rr)
x += g.colwidths[col]
}
x = startx
y += g.rowheights[row]
}
- return rr
+ return
}
// filling and stretchy are ignored for preferred size calculation