Hi everybody, today I’m trying to make a simple painting app and I found some interesting code on the corona blog:
local w = display.viewableContentWidth local h = display.viewableContentHeight local bg = display.newRect(0,0,w,h) bg.anchorX = 0 bg.anchorY = 0 local snapshot = display.newSnapshot(w,h) snapshot:translate(w\*0.5, h\*0.5) snapshot.canvasMode = "discard" function listener(event) local x,y = event.x - snapshot.x, event.y - snapshot.y if event.phase == "began" or event.phase == "moved" then local o = display.newImage("brush.png", x, y) o:setFillColor(1,0,0) snapshot.canvas:insert( o ) snapshot:invalidate("canvas") end end Runtime:addEventListener("touch", listener)
This sample is working nicely on the simulator but when I build it on my android device (galaxy s7) there are black artifacts all around my brush when I try to draw slowly as you see in the screenshot linked on this post.
While I concede this is an interesting effect it is very annoying for the goal of my app.
Do you know how I can fix this issue?
I’ve linked everything in the post to reproduce this bug.