aboutsummaryrefslogtreecommitdiff
path: root/src/im.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/im.lua')
-rw-r--r--src/im.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/im.lua b/src/im.lua
index cb583ff..d48d4bc 100644
--- a/src/im.lua
+++ b/src/im.lua
@@ -281,7 +281,7 @@ function im.slider(val, min, max, step, h)
rect_cmd(x, y, w, h, unpack(col))
p = handle / max_w
- return clamp(p * (max - min) + min, min, max)
+ return snap(clamp(p * (max - min) + min, min, max), step)
end
function im.begin_window(title, x, y, w, h, opts)
@@ -422,6 +422,7 @@ function im.draw()
for _, cmd in ipairs(win.cmds) do
cmd.fn(unpack(cmd.args))
end
+ win.cmds = {}
end
lg.setStencilTest()
end