summaryrefslogtreecommitdiff
path: root/xmake/core/ui/rect.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-01-12 00:39:22 +0800
committerruki <[email protected]>2018-01-11 21:56:13 +0800
commitb8276d35af753721b99e893d92485c99e2de111f (patch)
tree26f3228f129e671622e10e784aaa00ce85239dde /xmake/core/ui/rect.lua
parent3d4fcf847c7a7f365f84d4c4064597c66e124d4c (diff)
add buttons to dialog
Diffstat (limited to 'xmake/core/ui/rect.lua')
-rw-r--r--xmake/core/ui/rect.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/xmake/core/ui/rect.lua b/xmake/core/ui/rect.lua
index 623dc8ee6..c10d54377 100644
--- a/xmake/core/ui/rect.lua
+++ b/xmake/core/ui/rect.lua
@@ -54,6 +54,17 @@ function rect:move(dx, dy)
return self
end
+-- move rect to the given position
+function rect:move2(x, y)
+ local w = self.ex - self.sx
+ local h = self.ey - self.sy
+ self.sx = x
+ self.sy = y
+ self.ex = x + w
+ self.ey = y + h
+ return self
+end
+
-- move top right corner of the rect
function rect:moves(dx, dy)
self.sx = self.sx + dx