Commit 5c978cdd authored by David Schnur's avatar David Schnur

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.
parent bce10492
...@@ -735,6 +735,9 @@ ...@@ -735,6 +735,9 @@
var c = document.createElement('canvas'); var c = document.createElement('canvas');
c.className = cls; c.className = cls;
if (!c.getContext) // excanvas hack
c = window.G_vmlCanvasManager.initElement(c);
var cctx = c.getContext("2d"); var cctx = c.getContext("2d");
// Increase the canvas density based on the display's pixel ratio; basically // Increase the canvas density based on the display's pixel ratio; basically
...@@ -754,9 +757,6 @@ ...@@ -754,9 +757,6 @@
$(c).appendTo(placeholder); $(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 // Save the context so we can reset in case we get replotted
cctx.save(); cctx.save();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment