Open
Description
I've found that the Text.getMeasuredLineHeight() function is returning 0 in IE11 and is returning an inaccurate value (30% smaller than it should be) in Chrome 44.
I have to assume this has to do with how the rendering context is cached statically, because creating a function that uses the same methodology on a fresh context has allowed me to avoid the issue:
static getMeasuredLineHeight(text: createjs.Text): number {
if (!text || !text.stage || !text.stage.canvas)
return 0;
var canvas = <HTMLCanvasElement> text.stage.canvas;
var ctx = canvas.getContext("2d");
ctx.save();
ctx.font = text.font || "10px sans-serif";
ctx.textAlign = text.textAlign || "left";
ctx.textBaseline = text.textBaseline || "top";
var result = ctx.measureText("M").width * 1.2;
ctx.restore();
return result;
}