diff options
Diffstat (limited to 'xmake/core/ui/rect.lua')
| -rw-r--r-- | xmake/core/ui/rect.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/core/ui/rect.lua b/xmake/core/ui/rect.lua index 4e91ff702..005385922 100644 --- a/xmake/core/ui/rect.lua +++ b/xmake/core/ui/rect.lua @@ -45,6 +45,16 @@ function rect:size() return point { self.ex - self.sx, self.ey - self.sy } end +-- get width +function rect:width() + return self.ex - self.sx +end + +-- get height +function rect:height() + return self.ey - self.sy +end + -- resize rect function rect:resize(w, h) self.ex = self.sx + w |
