Commit d7c58b59 authored by David Schnur's avatar David Schnur

Enforce left-to-right canvas layout orientation.

When the placeholder has (or inherits) the HTML 'dir' attribute or CSS
'direction' we get unexpected results from text metrics, resulting in
visual glitches on the axes.

The suggested solution in #716 was to set ltr on the placeholder, but
this introduces its own problems, since the user probably *does* expect
rtl on items like the legend.  So we'll instead set ltr only on the
canvases.

We should review this behavior at some point; rtl is something we need
to handle, not work around.  It also needs to be kept in mind as we move
canvas-text into a plugin.  But for now this solution at least ensures
consistent behavior.
parent a6414cac
......@@ -744,8 +744,8 @@ Licensed under the MIT license.
var c = document.createElement('canvas');
c.className = cls;
$(c).css({ position: 'absolute', left: 0, top: 0 })
.appendTo(placeholder);
$(c).css({ direction: "ltr", position: "absolute", left: 0, top: 0 })
.appendTo(placeholder);
// If HTML5 Canvas isn't available, fall back to Excanvas
......
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