billy93 / forplay

Automatically exported from code.google.com/p/forplay
Apache License 2.0
0 stars 0 forks source link

Platforms inconsistently clear/don't clear surface before root layer #50

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
From: https://groups.google.com/forum/#!topic/gwt-forplay/rHbpUHECLKw

HTML GL and Android clear the surface before painting the root layer, while 
Flash and Java don't. Platforms should consistently clear the surface to rgba 
(0,0,0,0) before painting the root layer.

Original issue reported on code.google.com by mmast...@gmail.com on 24 Jun 2011 at 8:06

GoogleCodeExporter commented 9 years ago
Thanks, Matt.

Original comment by jgw@google.com on 24 Jun 2011 at 8:09

GoogleCodeExporter commented 9 years ago
I would suggest changing the playn.java.JavaCanvas method clear() body to:

   gfx.setColor(new Color(currentState().fillColor));
   gfx.fillRect(0, 0, width, height);

or similarly, instead of (the current implementation):

   gfx.clearRect(0, 0, width, height);

as per the JavaDoc for the java.awt.Graphics clearRect(int, int, int, int) 
method:

http://download.oracle.com/javase/1.5.0/docs/api/java/awt/Graphics.html#clearRec
t(int, int, int, int) 

Original comment by par.ekl...@gmail.com on 5 Nov 2011 at 5:03