diff options
| author | ruki <[email protected]> | 2018-01-12 00:39:22 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-01-11 21:56:13 +0800 |
| commit | b8276d35af753721b99e893d92485c99e2de111f (patch) | |
| tree | 26f3228f129e671622e10e784aaa00ce85239dde /xmake/core/ui/rect.lua | |
| parent | 3d4fcf847c7a7f365f84d4c4064597c66e124d4c (diff) | |
add buttons to dialog
Diffstat (limited to 'xmake/core/ui/rect.lua')
| -rw-r--r-- | xmake/core/ui/rect.lua | 11 |
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 |
