OLD | NEW |
1 var IS_SKV8 = typeof document == "undefined"; | 1 var IS_SKV8 = typeof document == "undefined"; |
2 var HAS_PATH = typeof Path2D != "undefined"; | 2 var HAS_PATH = typeof Path2D != "undefined"; |
3 | 3 |
4 function circlePath(r) { | 4 function circlePath(r) { |
5 if (HAS_PATH) { | 5 if (HAS_PATH) { |
6 var p = new Path2D(); | 6 var p = new Path2D(); |
7 p.arc(0, 0, r, 0, 2*Math.PI); | 7 p.arc(0, 0, r, 0, 2*Math.PI); |
8 p.closePath(); | 8 p.closePath(); |
9 return p; | 9 return p; |
10 } else { | 10 } else { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 var ctx = canvas.getContext("2d"); | 86 var ctx = canvas.getContext("2d"); |
87 function drawCallback() { | 87 function drawCallback() { |
88 onDraw(ctx); | 88 onDraw(ctx); |
89 setTimeout(drawCallback, 1); | 89 setTimeout(drawCallback, 1); |
90 } | 90 } |
91 setTimeout(drawCallback, 1); | 91 setTimeout(drawCallback, 1); |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 console.log("HAS_PATH: " + HAS_PATH); | 95 console.log("HAS_PATH: " + HAS_PATH); |
OLD | NEW |