From fdddde27805cdec9e407bb1241e1f7460c2576f4 Mon Sep 17 00:00:00 2001
From: faiface <faiface@ksp.sk>
Date: Mon, 15 May 2017 01:15:16 +0200
Subject: [PATCH] accept zero target size in Rect.Resized

---
 geometry.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/geometry.go b/geometry.go
index fc0f9be..8837300 100644
--- a/geometry.go
+++ b/geometry.go
@@ -243,10 +243,10 @@ func (r Rect) WithMax(max Vec) Rect {
 //   r.Resized(r.Max, size)      // same with the top-right corner
 //   r.Resized(r.Center(), size) // resizes around the center
 //
-// This function does not make sense for sizes of zero area and will panic. Use ResizedMin in the
-// case of zero area.
+// This function does not make sense for resizing a rectangle of zero area and will panic. Use
+// ResizedMin in the case of zero area.
 func (r Rect) Resized(anchor, size Vec) Rect {
-	if r.W()*r.H() == 0 || size.X()*size.Y() == 0 {
+	if r.W()*r.H() == 0 {
 		panic(fmt.Errorf("(%T).Resize: zero area", r))
 	}
 	fraction := V(size.X()/r.W(), size.Y()/r.H())
-- 
GitLab