summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2025-11-02 20:12:59 +0000
committerubq323 <ubq323@ubq323.website>2025-11-02 20:12:59 +0000
commit3027464a66505cefe10ade1d83466c582a2c3ae8 (patch)
tree9f69c6ee9ad9e7666ad9e9da340fbca057b45841
parentb7f3c4480a255be1874ba048c8257d00d1c0364a (diff)
rect: add from_cwh alias for from_centre_dims
-rw-r--r--rect.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/rect.lua b/rect.lua
index 827489b..0a1b79c 100644
--- a/rect.lua
+++ b/rect.lua
@@ -44,6 +44,7 @@ function Rect.from_centre_dims(cls, centre, width, hight)
w=width, h=hight,
}, cls)
end
+Rect.from_cwh = Rect.from_centre_dims
function Rect.has(self, point)
return self.x0 <= point.x and point.x <= self.x1