From 5c978cddca9af56b178ca1847762029b9e79d278 Mon Sep 17 00:00:00 2001 From: David Schnur Date: Wed, 25 Jul 2012 17:50:54 -0400 Subject: [PATCH] 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. --- jquery.flot.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery.flot.js b/jquery.flot.js index e5ee913..453ebc7 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -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();