summaryrefslogtreecommitdiff
path: root/xmake/core/ui/rect.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-01-13 00:28:57 +0800
committerruki <[email protected]>2018-01-12 20:53:47 +0800
commitbcb58d536cb131be4358d8893cfd1db77f72d942 (patch)
treedc283ebaf56f2f6f8555f0c030275dd17ed9c024 /xmake/core/ui/rect.lua
parent5d8d758fa2fb4a8e9691dae010b97725c6b736c0 (diff)
add box dialog
Diffstat (limited to 'xmake/core/ui/rect.lua')
-rw-r--r--xmake/core/ui/rect.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/xmake/core/ui/rect.lua b/xmake/core/ui/rect.lua
index c10d54377..4e91ff702 100644
--- a/xmake/core/ui/rect.lua
+++ b/xmake/core/ui/rect.lua
@@ -45,6 +45,12 @@ function rect:size()
return point { self.ex - self.sx, self.ey - self.sy }
end
+-- resize rect
+function rect:resize(w, h)
+ self.ex = self.sx + w
+ self.ey = self.sy + h
+end
+
-- move rect
function rect:move(dx, dy)
self.sx = self.sx + dx