Fixed an error when native canvas isn't available.

The recent changes to add retina support included a call to getContext
made before excanvas/flashcanvas had a chance to register their hooks;
fixed by moving that code up a few lines.
pull/1/head
David Schnur 14 years ago
parent bce10492e4
commit 5c978cddca

@ -735,6 +735,9 @@
var c = document.createElement('canvas');
c.className = cls;
if (!c.getContext) // excanvas hack
c = window.G_vmlCanvasManager.initElement(c);
var cctx = c.getContext("2d");
// Increase the canvas density based on the display's pixel ratio; basically
@ -754,9 +757,6 @@
$(c).appendTo(placeholder);
if (!c.getContext) // excanvas hack
c = window.G_vmlCanvasManager.initElement(c);
// Save the context so we can reset in case we get replotted
cctx.save();

Loading…
Cancel
Save