(Sent via email as well.)
I’ve been working with a line-draw demo that I think Carlos wrote. It draws lines segments as you move your finger around the screen. After a certain point it stops drawing more line segments. Sometimes after just a second or two, sometimes after over 1000 segments are added.
It looked like a bug in the Lua code, so I spent some time narrowing it down. Eventually I boiled it down to this test program:
local pts = {}
table.insert(pts, {x=200, y=200}) -----MOVE THIS-----
table.insert(pts, {x=65, y=65})
table.insert(pts, {x=62, y=68})
table.insert(pts, {x=63, y=67})
local line = display.newLine(pts[1].x, pts[1].y, pts[2].x, pts[2].y)
for i = 3, #pts, 1 do
line:append(pts[i].x, pts[i].y)
end
line:setColor(255,128,0)
line.width=4
The version above works. BUT…
If I move the “MOVE THIS” line down by one (below the 65,65 point), I get something very different. The line extends beyond 200,200 - beyond the right side of the screen.
If I move the “MOVE THIS” line down once more, the line extends off both the left and right sides. That’s a weird one.
Finally, if I move it down again so it’s the last of the four table.insert lines, it doesn’t draw to the last point at all. Only the first three points are drawn.
Unless there’s an error in the Lua code, this looks like a bug in Corona.
[import]uid: 9659 topic_id: 5132 reply_id: 305132[/import]