Fix possible excanvas leak (report and suggested fix by tom9729)

git-svn-id: https://flot.googlecode.com/svn/trunk@284 1e0a6537-2640-0410-bfb7-f154510ff394
pull/1/head
olau@iola.dk 16 years ago
parent a1f56d5bd9
commit cc031e0a86

@ -111,7 +111,9 @@ Bug fixes:
- Listen for mouseleave events and fire a plothover event with empty
item when it occurs to drop highlights when the mouse leaves the
plot (reported by by outspirit).
- Fix bug with using aboveData with a background (reported by amitayd).
- Fix bug with using aboveData with a background (reported by
amitayd).
- Fix possible excanvas leak (report and suggested fix by tom9729).
Flot 0.6

@ -699,15 +699,28 @@
function constructCanvas() {
canvasWidth = placeholder.width();
canvasHeight = placeholder.height();
// excanvas hack, if there are any canvases here, whack
// the state on them manually
if (window.G_vmlCanvasManager)
placeholder.find("canvas").each(function () {
delete this.context_;
});
placeholder.html(""); // clear placeholder
if (placeholder.css("position") == 'static')
placeholder.css("position", "relative"); // for positioning labels and overlay
if (canvasWidth <= 0 || canvasHeight <= 0)
throw "Invalid dimensions for plot, width = " + canvasWidth + ", height = " + canvasHeight;
if (window.G_vmlCanvasManager) // excanvas hack, make sure everything is setup
// excanvas hack, make sure everything is setup
if (window.G_vmlCanvasManager
&& !window.G_vmlCanvasManager.inited) {
window.G_vmlCanvasManager.inited = true;
window.G_vmlCanvasManager.init_(document);
}
function makeCanvas(skipPositioning) {
var c = document.createElement('canvas');

Loading…
Cancel
Save