diff --git a/loveframes/objects/columnlist.lua b/loveframes/objects/columnlist.lua index d728175..084a727 100644 --- a/loveframes/objects/columnlist.lua +++ b/loveframes/objects/columnlist.lua @@ -128,6 +128,10 @@ function newobject:draw() -- set the object's draw order self:SetDrawOrder() + + love.graphics.setStencilMode("replace", "always", 1) -- start stencil + stencilfunc() + love.graphics.setStencilMode("keep", "greater", 0) local drawfunc = self.Draw or self.drawfunc if drawfunc then @@ -140,10 +144,7 @@ function newobject:draw() v:draw() end end - - love.graphics.stencil(stencilfunc) - love.graphics.setStencilTest("greater", 0) - + local children = self.children if children then for k, v in ipairs(children) do @@ -155,7 +156,7 @@ function newobject:draw() if drawfunc then drawfunc(self) end - love.graphics.setStencilTest() + love.graphics.setStencilMode() end diff --git a/loveframes/objects/internal/columnlist/columnlistarea.lua b/loveframes/objects/internal/columnlist/columnlistarea.lua index f4d3458..d86aa15 100644 --- a/loveframes/objects/internal/columnlist/columnlistarea.lua +++ b/loveframes/objects/internal/columnlist/columnlistarea.lua @@ -124,8 +124,9 @@ function newobject:draw() drawfunc(self) end - love.graphics.stencil(stencilfunc) - love.graphics.setStencilTest("greater", 0) + love.graphics.setStencilMode("replace", "always", 1) -- start stencil + stencilfunc() + love.graphics.setStencilMode("keep","greater", 0) local children = self.children if children then @@ -137,7 +138,7 @@ function newobject:draw() end end - love.graphics.setStencilTest() + love.graphics.setStencilMode() drawfunc = self.DrawOver or self.drawoverfunc if drawfunc then diff --git a/loveframes/objects/internal/linenumberspanel.lua b/loveframes/objects/internal/linenumberspanel.lua index 79fbcd6..b9c2fdd 100644 --- a/loveframes/objects/internal/linenumberspanel.lua +++ b/loveframes/objects/internal/linenumberspanel.lua @@ -98,15 +98,16 @@ function newobject:draw() self:SetDrawOrder() - love.graphics.stencil(stencilfunc) - love.graphics.setStencilTest("greater", 0) + love.graphics.setStencilMode("replace", "always", 1) -- start stencil + stencilfunc() + love.graphics.setStencilMode("keep", "greater", 0) local drawfunc = self.Draw or self.drawfunc if drawfunc then drawfunc(self) end - - love.graphics.setStencilTest() + + love.graphics.setStencilMode("keep", "greater", 0) end diff --git a/loveframes/objects/tabs.lua b/loveframes/objects/tabs.lua index 2d9fc53..4c19892 100644 --- a/loveframes/objects/tabs.lua +++ b/loveframes/objects/tabs.lua @@ -143,9 +143,10 @@ function newobject:draw() if drawfunc then drawfunc(self) end - - love.graphics.stencil(stencilfunc) - love.graphics.setStencilTest("greater", 0) + + love.graphics.setStencilMode("replace", "always", 1) -- start stencil + stencilfunc() + love.graphics.setStencilMode("keep", "greater", 0) local internals = self.internals if internals then @@ -157,7 +158,7 @@ function newobject:draw() end end - love.graphics.setStencilTest() + love.graphics.setStencilMode() local children = self.children if #children > 0 then diff --git a/loveframes/objects/textinput.lua b/loveframes/objects/textinput.lua index e91c283..4bc63fc 100644 --- a/loveframes/objects/textinput.lua +++ b/loveframes/objects/textinput.lua @@ -286,24 +286,25 @@ function newobject:draw() if vbar and hbar then stencilfunc = function() love.graphics.rectangle("fill", x, y, width - 16, height - 16) end end - - love.graphics.stencil(stencilfunc) - love.graphics.setStencilTest("greater", 0) + + love.graphics.setStencilMode("replace", "always", 1) -- start stencil + stencilfunc() + love.graphics.setStencilMode("keep", "greater", 0) local drawfunc = self.Draw or self.drawfunc if drawfunc then drawfunc(self) end - - love.graphics.setStencilTest() - + local internals = self.internals if internals then for k, v in ipairs(internals) do v:draw() end end - + + love.graphics.setStencilMode() + drawfunc = self.DrawOver or self.drawoverfunc if drawfunc then drawfunc(self) diff --git a/loveframes/objects/tree.lua b/loveframes/objects/tree.lua index f1bb1e6..ac178a3 100644 --- a/loveframes/objects/tree.lua +++ b/loveframes/objects/tree.lua @@ -179,9 +179,10 @@ function newobject:draw() end self:SetDrawOrder() - - love.graphics.stencil(stencilfunc) - love.graphics.setStencilTest("greater", 0) + + love.graphics.setStencilMode("replace", "always", 1) -- start stencil + stencilfunc() + love.graphics.setStencilMode("keep", "greater", 0) local drawfunc = self.Draw or self.drawfunc if drawfunc then @@ -194,8 +195,8 @@ function newobject:draw() v:draw() end end - - love.graphics.setStencilTest() + + love.graphics.setStencilMode() local internals = self.internals if internals then