Skip to content

Commit

Permalink
fillText's maxwidth looks horrible in FF
Browse files Browse the repository at this point in the history
  • Loading branch information
philogb committed Jun 24, 2010
1 parent 307d82d commit 1929a46
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Source/Visualizations/BarChart.js
Expand Up @@ -80,18 +80,18 @@ $jit.ST.Plot.NodeTypes.implement({
ctx.fillText(valAcum, x + acum - config.labelOffset, y + height/2);
} else {
ctx.textAlign = 'center';
ctx.fillText(valAcum, x + width/2, y - height - label.size/2 - config.labelOffset, width);
ctx.fillText(valAcum, x + width/2, y - height - label.size/2 - config.labelOffset);
}
}
if(showLabels(node.name, valAcum, node)) {
if(horz) {
ctx.textAlign = 'center';
ctx.translate(x - config.labelOffset - label.size/2, y + height/2);
ctx.rotate(Math.PI / 2);
ctx.fillText(node.name, 0, 0, width);
ctx.fillText(node.name, 0, 0);
} else {
ctx.textAlign = 'center';
ctx.fillText(node.name, x + width/2, y + label.size/2 + config.labelOffset, width);
ctx.fillText(node.name, x + width/2, y + label.size/2 + config.labelOffset);
}
}
ctx.restore();
Expand Down Expand Up @@ -226,18 +226,18 @@ $jit.ST.Plot.NodeTypes.implement({
ctx.fillText(valAcum, x + Math.max.apply(null, dimArray) - config.labelOffset, y + height/2);
} else {
ctx.textAlign = 'center';
ctx.fillText(valAcum, x + width/2, y - Math.max.apply(null, dimArray) - label.size/2 - config.labelOffset, width);
ctx.fillText(valAcum, x + width/2, y - Math.max.apply(null, dimArray) - label.size/2 - config.labelOffset);
}
}
if(showLabels(node.name, valAcum, node)) {
if(horz) {
ctx.textAlign = 'center';
ctx.translate(x - config.labelOffset - label.size/2, y + height/2);
ctx.rotate(Math.PI / 2);
ctx.fillText(node.name, 0, 0, width);
ctx.fillText(node.name, 0, 0);
} else {
ctx.textAlign = 'center';
ctx.fillText(node.name, x + width/2, y + label.size/2 + config.labelOffset, width);
ctx.fillText(node.name, x + width/2, y + label.size/2 + config.labelOffset);
}
}
ctx.restore();
Expand Down

0 comments on commit 1929a46

Please sign in to comment.