How to get dart2js javascript that uses canvas.context2D to work on firefox or safari?

95 views Asked by At

I have program that seems to compile with dart2js enough for UI such as checkbox working, and even can do

CanvasRenderingContext2D context=canvas.context2D;

context
..setFillColorRgb(200,200,250,1)
..beginPath()
..fillRect(0,0,width, height)
..closePath();

on firefox, ( not Safari).

But it won't do

context
..setStrokeColorRgb(255,0,255)
..lineWidth=10
..beginPath()
..arc(w/2,h/2, r, 0, math.PI*2, false)
..closePath()
..stroke()

It works on Chrome, and chromium ( native dart). How to fix ?

1

There are 1 answers

0
si t On

I used context.resetTranform() , after removing this statement, it worked on Safari chrome and firefox.