From 214467bb939db60ae6080fc83f7009f14c84982a Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 26 Jun 2014 10:36:59 -0400 Subject: Implemented window margins for Grids and Stacks. --- grid.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'grid.go') diff --git a/grid.go b/grid.go index 53c7d35..8a42bcf 100644 --- a/grid.go +++ b/grid.go @@ -139,8 +139,11 @@ func (g *Grid) allocate(x int, y int, width int, height int, d *sysSizeData) (al ymargin := d.ymargin d.xmargin = 0 d.ymargin = 0 -_=xmargin -_=ymargin + // 0) inset the available rect by the margins + x += xmargin + y += ymargin + width -= xmargin * 2 + height -= ymargin * 2 // 1) clear data structures for i := range g.rowheights { g.rowheights[i] = 0 -- cgit v1.2.3