Commit e85a190e authored by David Schnur's avatar David Schnur

Removed unnecessary canvas skipPositioning flag.

The primary canvas uses position: absolute while the overlay canvas does
not.  This can cause the two to get out of alignment in rare cases when
floating elements are placed near the plot placeholder.  There doesn't
appear to be any reason why the overlay can't also be
absolutely-positioned, so I've just removed the flag entirely.
parent fa025fab
...@@ -738,15 +738,13 @@ Licensed under the MIT license. ...@@ -738,15 +738,13 @@ Licensed under the MIT license.
return devicePixelRatio / backingStoreRatio; return devicePixelRatio / backingStoreRatio;
} }
function makeCanvas(skipPositioning, cls) { function makeCanvas(cls) {
var c = document.createElement('canvas'); var c = document.createElement('canvas');
c.className = cls; c.className = cls;
if (!skipPositioning) $(c).css({ position: 'absolute', left: 0, top: 0 })
$(c).css({ position: 'absolute', left: 0, top: 0 }); .appendTo(placeholder);
$(c).appendTo(placeholder);
// If HTML5 Canvas isn't available, fall back to Excanvas // If HTML5 Canvas isn't available, fall back to Excanvas
...@@ -842,8 +840,8 @@ Licensed under the MIT license. ...@@ -842,8 +840,8 @@ Licensed under the MIT license.
getCanvasDimensions(); getCanvasDimensions();
canvas = makeCanvas(true, "flot-base"); canvas = makeCanvas("flot-base");
overlay = makeCanvas(false, "flot-overlay"); // overlay canvas for interactive features overlay = makeCanvas("flot-overlay"); // overlay canvas for interactive features
reused = false; reused = false;
} }
......
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