From c49c77a1161b946ac1ac5ade942f65c431cdc879 Mon Sep 17 00:00:00 2001
From: faiface <faiface@ksp.sk>
Date: Wed, 5 Jul 2017 19:35:11 +0200
Subject: [PATCH] add Rect.Area

---
 geometry.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/geometry.go b/geometry.go
index 503d8cb..56283a9 100644
--- a/geometry.go
+++ b/geometry.go
@@ -203,6 +203,11 @@ func (r Rect) Size() Vec {
 	return V(r.W(), r.H())
 }
 
+// Area returns the area of r. If r is not normalized, area may be negative.
+func (r Rect) Area() float64 {
+	return r.W() * r.H()
+}
+
 // Center returns the position of the center of the Rect.
 func (r Rect) Center() Vec {
 	return Lerp(r.Min, r.Max, 0.5)
-- 
GitLab