From 48714b77d2a6716d2828cfb43b891a246b88ec9d Mon Sep 17 00:00:00 2001 From: Anthony Dong Date: Sun, 13 May 2018 19:27:51 +0200 Subject: [PATCH] Fix grid layout rectangle bounds check Width and Height must be strictly positive. --- gridlayout.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gridlayout.go b/gridlayout.go index f4d54eb7..4e985047 100644 --- a/gridlayout.go +++ b/gridlayout.go @@ -273,8 +273,8 @@ func (l *GridLayout) SetRange(widget Widget, r Rectangle) error { if r.X < 0 || r.Y < 0 { return newError("range.X and range.Y must be >= 0") } - if r.Width < 0 || r.Height < 0 { - return newError("range.Width and range.Height must be > 1") + if r.Width < 1 || r.Height < 1 { + return newError("range.Width and range.Height must be >= 1") } info := l.widget2Info[widget]