Skip to content

Commit

Permalink
Fixed issue with soft-breaking text adding two lines when a hard brea…
Browse files Browse the repository at this point in the history
…k (<br/>) was present.
  • Loading branch information
highslide-software committed Feb 7, 2011
1 parent 1085cdc commit f957327
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions js/highcharts.src.js
Expand Up @@ -2204,15 +2204,17 @@ SVGRenderer.prototype = {
if (!tooLong || words.length == 1) { // new line needed
words = rest;
rest = [];
tspan = doc.createElementNS(SVG_NS, 'tspan');
attr(tspan, {
x: parentX,
dy: textLineHeight || 16
});
textNode.appendChild(tspan);
if (words.length) {
tspan = doc.createElementNS(SVG_NS, 'tspan');
attr(tspan, {
x: parentX,
dy: textLineHeight || 16
});
textNode.appendChild(tspan);

if (actualWidth > width) { // a single word is pressing it out
width = actualWidth;
if (actualWidth > width) { // a single word is pressing it out
width = actualWidth;
}
}
} else { // append to existing line tspan
tspan.removeChild(tspan.firstChild);
Expand Down

0 comments on commit f957327

Please sign in to comment.