From 982da8c896fa9ec5c7742afa97f611b3ff91c172 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 3 Sep 2014 21:31:38 -0400 Subject: Fixed a dumb bug in Grid that prevented the scrollbars in Area from showing up. --- grid.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'grid.go') diff --git a/grid.go b/grid.go index 6f76663..88c6d69 100644 --- a/grid.go +++ b/grid.go @@ -311,7 +311,7 @@ func (g *grid) allocate(x int, y int, width int, height int, d *sizing) (allocat prev := -1 for x := 0; x < g.xmax; x++ { i := gg[y][x] - if i != -1 { + if i != -1 && y == g.controls[i].y { // don't repeat this step if the control spans vertically if i != prev { g.controls[i].finalx = curx } else { @@ -328,7 +328,7 @@ func (g *grid) allocate(x int, y int, width int, height int, d *sizing) (allocat prev := -1 for y := 0; y < g.ymax; y++ { i := gg[y][x] - if i != -1 { + if i != -1 && x == g.controls[i].x { // don't repeat this step if the control spans horizontally if i != prev { g.controls[i].finaly = cury } else { @@ -400,7 +400,7 @@ func (g *grid) preferredSize(d *sizing) (width, height int) { gg, colwidths, rowheights := g.mkgrid() // 1) compute colwidths and rowheights before handling expansion - // TODO put this in its own function + // TODO put this in its own function (but careful about the spanning calculation in allocate()) for y := 0; y < len(gg); y++ { for x := 0; x < len(gg[y]); x++ { i := gg[y][x] -- cgit v1.2.3