aboutsummaryrefslogtreecommitdiff
path: root/src/syslua/lx/tk.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/syslua/lx/tk.lua')
-rw-r--r--src/syslua/lx/tk.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/syslua/lx/tk.lua b/src/syslua/lx/tk.lua
index ceacba9..cc95bbe 100644
--- a/src/syslua/lx/tk.lua
+++ b/src/syslua/lx/tk.lua
@@ -69,6 +69,8 @@ end
function tk.widget(width, height)
local w = {
+ x = 0,
+ y = 0,
width = width,
height = height,
}
@@ -248,8 +250,7 @@ function tk.wm_widget()
self.x = self.x + nx - px
self.y = self.y + ny - py
local reg2 = {x = self.x, y = self.y, w = self.width, h = self.height}
- local pieces = region_diff(reg1, reg2)
- table.insert(pieces, reg2)
+ local pieces = region_union(reg1, reg2)
for _, p in pairs(pieces) do
wm:redraw_region(p.x, p.y, p.w, p.h)
end