Nit
This commit is contained in:
parent
49a303f2f2
commit
9ddc40c3d7
@ -106,7 +106,7 @@ var CanvasGraphics = (function canvasGraphics() {
|
|||||||
this.ctx.scale(cw / mediaBox.width, ch / mediaBox.height);
|
this.ctx.scale(cw / mediaBox.width, ch / mediaBox.height);
|
||||||
this.textDivs = [];
|
this.textDivs = [];
|
||||||
this.textLayerQueue = [];
|
this.textLayerQueue = [];
|
||||||
// Prevent textLayerQueue to be rendered while rendering a new page
|
// Prevent textLayerQueue from being rendered while rendering a new page
|
||||||
if (this.textLayerTimer)
|
if (this.textLayerTimer)
|
||||||
clearTimeout(this.textLayerTimer);
|
clearTimeout(this.textLayerTimer);
|
||||||
},
|
},
|
||||||
@ -166,7 +166,7 @@ var CanvasGraphics = (function canvasGraphics() {
|
|||||||
var self = this;
|
var self = this;
|
||||||
this.ctx.restore();
|
this.ctx.restore();
|
||||||
|
|
||||||
var textLayer = self.textLayer;
|
var textLayer = this.textLayer;
|
||||||
if (textLayer) {
|
if (textLayer) {
|
||||||
var renderTextLayer = function canvasRenderTextLayer() {
|
var renderTextLayer = function canvasRenderTextLayer() {
|
||||||
var textDivs = self.textDivs;
|
var textDivs = self.textDivs;
|
||||||
@ -557,10 +557,10 @@ var CanvasGraphics = (function canvasGraphics() {
|
|||||||
ctx.translate(current.x, -1 * current.y);
|
ctx.translate(current.x, -1 * current.y);
|
||||||
ctx.transform.apply(ctx, font.fontMatrix || IDENTITY_MATRIX);
|
ctx.transform.apply(ctx, font.fontMatrix || IDENTITY_MATRIX);
|
||||||
ctx.scale(1 / textHScale, 1);
|
ctx.scale(1 / textHScale, 1);
|
||||||
var inv = ctx.mozCurrentTransform;
|
var ctxMatrix = ctx.mozCurrentTransform;
|
||||||
if (inv) {
|
if (ctxMatrix) {
|
||||||
var bl = Util.applyTransform([0, 0], inv);
|
var bl = Util.applyTransform([0, 0], ctxMatrix);
|
||||||
var tr = Util.applyTransform([1, 1], inv);
|
var tr = Util.applyTransform([1, 1], ctxMatrix);
|
||||||
text.geom.x = bl[0];
|
text.geom.x = bl[0];
|
||||||
text.geom.y = bl[1];
|
text.geom.y = bl[1];
|
||||||
text.geom.xFactor = tr[0] - bl[0];
|
text.geom.xFactor = tr[0] - bl[0];
|
||||||
@ -601,7 +601,7 @@ var CanvasGraphics = (function canvasGraphics() {
|
|||||||
malformed('TJ array element ' + e + ' is not string or num');
|
malformed('TJ array element ' + e + ' is not string or num');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (textLayer) {
|
if (textLayer) {
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
var fontHeight = text.geom.yFactor * fontSize;
|
var fontHeight = text.geom.yFactor * fontSize;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user