corona icon indicating copy to clipboard operation
corona copied to clipboard

[All platforms]: Using capture functions removes any objects created on that same frame

Open pouwelsjochem opened this issue 2 years ago • 3 comments

Describe the bug Since Solar2D 3691, using any display capture functionality removes display objects created on the same frame. Running the code below results in 2 rectangles on Solar2D 3690, and just the white rectangle on 3691.

Screenshot 2023-10-11 at 14 31 30

Probably related to: https://github.com/coronalabs/corona/pull/566

To Reproduce

local whiteRect = display.newRect(display.contentCenterX, display.contentCenterY, 20, 20)
whiteRect:setFillColor(1, 1, 1)

timer.performWithDelay(1, function()
   local redRect = display.newRect(display.contentCenterX, display.contentCenterY + 20, 20, 20)
   redRect:setFillColor(1, 0, 0)
   
   display.colorSample(14, 14, function() end)
end)

pouwelsjochem avatar Oct 11 '23 12:10 pouwelsjochem

@pouwelsjochem I have tested your code on Solar2D 3691 and I am getting both white and red rectangles.

elpida-v avatar Oct 12 '23 10:10 elpida-v

Interesting, what device did you test on? I'm on a M1 Mac

pouwelsjochem avatar Oct 12 '23 12:10 pouwelsjochem

I am on M1 Mac Mini with Ventura 13.4.1.

elpida-v avatar Oct 12 '23 13:10 elpida-v