rebuild ui on resize

This commit is contained in:
jill 2021-09-19 22:47:01 +03:00
parent 756bbfdc99
commit 18a69b1ba5
2 changed files with 6 additions and 2 deletions

View file

@ -156,3 +156,7 @@ function love.keypressed(key)
end end
end end
end end
function love.resize()
createUI()
end

View file

@ -99,7 +99,7 @@ function self.render()
-- polygone -- polygone
-- this isnt done with a polygon because else itd waste a Bunch of ram and i kinda, dont want to do that? -- this isnt done with a polygon because else itd waste a Bunch of ram and i kinda, dont want to do that?
love.graphics.setColor(1, 1, 1, 1) love.graphics.setColor(1, 1, 1, 1)
love.graphics.setScissor(x + margin, y + margin, w - (margin * 2), h - (margin * 2)) love.graphics.setScissor(x + margin, y + margin, math.abs(w - (margin * 2)), math.abs(h - (margin * 2)))
local last = (((graph[1] or 0) - 0.5) * zoome) + 0.5 local last = (((graph[1] or 0) - 0.5) * zoome) + 0.5
for gx = 1, quality - 1 do for gx = 1, quality - 1 do
local a = gx/quality local a = gx/quality
@ -129,7 +129,7 @@ function self.render()
-- preview -- preview
if not screenshot then if not screenshot then
love.graphics.setScissor(x - margin, 0, w + margin * 2, sh) love.graphics.setScissor(x - margin, 0, math.abs(w + margin * 2), sh)
love.graphics.setColor(0.16, 0.16, 0.17, 1) love.graphics.setColor(0.16, 0.16, 0.17, 1)
love.graphics.line(x + margin, y + h + padding * 2 + csize/2, x + w - margin, y + h + padding * 2 + csize/2) love.graphics.line(x + margin, y + h + padding * 2 + csize/2, x + w - margin, y + h + padding * 2 + csize/2)
love.graphics.setColor(0.3, 0.3, 0.31, 1) love.graphics.setColor(0.3, 0.3, 0.31, 1)