Commit 745d24cc authored by David Schnur's avatar David Schnur

Default lineHeight based on the font size.

Flot 0.8.0 used the default font size, typically derived from the
placeholder, as the basis for the default lineHeight.  This produced
incorrect results when a font.size was provided explicitly, and it
differed from the placeholder’s CSS size.

Fixed by waiting to default lineHeight until the actual font size has
been resolved.  Fixes #1131.
parent 7fa063e9
......@@ -762,8 +762,6 @@ Licensed under the MIT license.
family: placeholder.css("font-family")
};
fontDefaults.lineHeight = fontDefaults.size * 1.15;
axisCount = options.xaxes.length || 1;
for (i = 0; i < axisCount; ++i) {
......@@ -780,6 +778,9 @@ Licensed under the MIT license.
if (!axisOptions.font.color) {
axisOptions.font.color = axisOptions.color;
}
if (!axisOptions.font.lineHeight) {
axisOptions.font.lineHeight = Math.round(axisOptions.font.size * 1.15);
}
}
}
......@@ -799,6 +800,9 @@ Licensed under the MIT license.
if (!axisOptions.font.color) {
axisOptions.font.color = axisOptions.color;
}
if (!axisOptions.font.lineHeight) {
axisOptions.font.lineHeight = Math.round(axisOptions.font.size * 1.15);
}
}
}
......
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