From 3ba1b81c165f8f0ebd158b677baec3ed05994adf Mon Sep 17 00:00:00 2001 From: Richard Wilkes Date: Sat, 13 Apr 2019 18:52:13 -0700 Subject: [PATCH] ConstrainForHint now ignores values less than 1 --- xmath/geom/size.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmath/geom/size.go b/xmath/geom/size.go index 769a551..8722043 100644 --- a/xmath/geom/size.go +++ b/xmath/geom/size.go @@ -44,12 +44,12 @@ func (s *Size) GrowToInteger() { } // ConstrainForHint ensures this size is no larger than the hint. Hint values -// less than zero are ignored. +// less than one are ignored. func (s *Size) ConstrainForHint(hint Size) { - if hint.Width >= 0 && s.Width > hint.Width { + if hint.Width >= 1 && s.Width > hint.Width { s.Width = hint.Width } - if hint.Height >= 0 && s.Height > hint.Height { + if hint.Height >= 1 && s.Height > hint.Height { s.Height = hint.Height } }