aboutsummaryrefslogtreecommitdiff
path: root/src/im.lua
diff options
context:
space:
mode:
authorne_mene <[email protected]>2026-04-03 16:18:43 +0200
committerne_mene <[email protected]>2026-04-03 16:18:43 +0200
commit7d0786ff6ffb3453f52b07e40e0e728488c96112 (patch)
tree960dd6dcc79eb3bf8bcf5fc611f35b91cb68ab47 /src/im.lua
parent5fe3229e00c8eb7e7affbde0ef0e063e0e321b1b (diff)
parent623c351bab9e63c421939dc94d6930f9d94ba8d8 (diff)
Merge remote-tracking branch 'refs/remotes/origin/main'
yeah.
Diffstat (limited to 'src/im.lua')
-rw-r--r--src/im.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/im.lua b/src/im.lua
index d48d4bc..5fda823 100644
--- a/src/im.lua
+++ b/src/im.lua
@@ -66,9 +66,11 @@ local function draw_img(img, x, y, quad)
end
local function draw_stencil(x, y, w, h)
- lg.stencil(function()
- lg.rectangle("fill", x, y, w, h)
- end, "replace", 1)
+ lg.setStencilMode("draw", 0)
+ lg.rectangle("fill", 0, 0, lg.getDimensions()) -- WHY DOESN'T LG.CLEAR() WORK RAAAAAGH
+ lg.setStencilMode("draw", 1)
+ lg.rectangle("fill", x, y, w, h)
+ lg.setStencilMode("test", 1)
end
local function text_cmd(text, x, y, r, g, b)
@@ -417,14 +419,14 @@ function im.end_step()
end
function im.draw()
- lg.setStencilTest("greater", 0)
+ lg.setStencilMode("test", 1)
for _, win in ipairs(wins) do
for _, cmd in ipairs(win.cmds) do
cmd.fn(unpack(cmd.args))
end
win.cmds = {}
end
- lg.setStencilTest()
+ lg.setStencilMode()
end
function im.has_focus()