nikhilbchilwant / google-web-toolkit-incubator

Automatically exported from code.google.com/p/google-web-toolkit-incubator
1 stars 1 forks source link

In IE, GWTCanvas can draw small arcs (angles < 0.0001) as if they were almost 2*Pi #282

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If you keep pressing refresh in Hosted, IE7, the output alternates randomly 
between showing a tiny 0.0001 radians slice and showing a giant 2*Pi-0.0001 
radians slice.

If you gradually reduce delta, the big slice variant appears more often;
increasing delta produced the correct small slice variant more often.

In FF2, you always see the correct, tiny, slice.

     GWTCanvas canvas = new GWTCanvas(200, 200);
     // draw a tiny pie slice at a randomly selected orientation
     canvas.beginPath();
     double angle0 = Math.random()*2*Math.PI;
     double delta = 0.0001; 
     canvas.arc(100, 100, 50, angle0, angle0+delta, false);
     canvas.lineTo(100,100); 
     canvas.closePath();
     canvas.stroke();
     RootPanel.get().add(canvas);
     RootPanel.get().add(new Label("Angle0=" + angle0 + " delta="+delta));     

Workaround: round such small deltas up to around 0.001 (and trust that the 
screen has a low enough resolution).

Seems related to issue #238

Original issue reported on code.google.com by johncurt...@gmail.com on 26 May 2009 at 6:45