windrobin / flashcanvas

Automatically exported from code.google.com/p/flashcanvas
0 stars 0 forks source link

isPointInPath() affects ordering of last object #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
http://home.syranide.com/fcerr.html

Using the latest FlashCanvas 1.21 (pro).

Issuing isPointInPath() before the last fill() for the frame causes that fill 
to be drawn at the bottom rather than at the top if one uses a timer with 1ms 
interval. If using a larger interval, say 100ms, that fill will instead flicker 
(rendered at bottom first, then on top).

Removing the call to isPointInPath() makes everything normal again.

Original issue reported on code.google.com by andr...@cetrez.com on 15 Jun 2010 at 9:58

GoogleCodeExporter commented 9 years ago
Attached file instead.

Original comment by andr...@cetrez.com on 15 Jun 2010 at 9:58

Attachments:

GoogleCodeExporter commented 9 years ago
Hmm, that's odd. I'll check the code later.

Original comment by revu...@gmail.com on 15 Jun 2010 at 11:04

GoogleCodeExporter commented 9 years ago
I'm currently working around this by issuing "ctx.isPointInPath(0,0);" when I'm 
done rendering. That seems to stop it from being weird, although obviously it's 
not really a solution.

Original comment by andr...@cetrez.com on 15 Jun 2010 at 11:09

GoogleCodeExporter commented 9 years ago
I understand the cause of the problem. The squares merely flicker, and they 
don't change their orders.

Some Canvas commands such as isPointInPath() and getImageData() flush the 
command buffer since these commands must check the latest state of Canvas.

So, in the case of your example, the first nine squares are rendered 
immediately. But the last square is rendered after a while because the last 
fill() command is executed after the last isPointInPath().

That's the reason why the flicker stops when you add "ctx.isPointInPath(0,0);".

Original comment by revu...@gmail.com on 16 Jun 2010 at 9:15

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r86.

Original comment by revu...@gmail.com on 20 Jun 2010 at 8:21

GoogleCodeExporter commented 9 years ago
I mistyped when I committed r86. r86 fixed issue 3. This issue is not fixed.

Original comment by revu...@gmail.com on 20 Jun 2010 at 8:30