microstudio
microstudio copied to clipboard
setTranslation affect gradient for fillRect but not drawLine
This was very odd and it jumps out in very specific case:
so i wrote a minimal test:
drawTest = function(x,y)
local w = 48
local h = 48
screen.setLinearGradient(x,y-h/2,x,y+h/2,"rgb(0,0,255)","rgb(255,0,0)")
screen.fillRect(x,y,w,h)
screen.setLineWidth(5)
screen.drawLine(x,y-h/2,x,y+h/2)
screen.setLineWidth(1)
end
draw = function()
screen.setTranslation(0)
drawTest(-36,36)
drawTest(-36,-36)
screen.setTranslation(10,0)
drawTest(36,36)
drawTest(36,-36)
end
enjoy!
I swear I already tried twice to understand this bug but failed miserably each time. I will get back to it sometime!