Skip to content

Commit 4bf79f0

Browse files
authored
Merge pull request #1096 from Flamenco/hot_fix_scale_rotated_text
Hot fix scale rotated text
2 parents 9072fed + 9cbac23 commit 4bf79f0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

plugins/context2d.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,11 @@
299299
this.path = origPath;
300300
}
301301

302+
var scale;
302303
var scale;
303304
if (this.pdf.hotfix && this.pdf.hotfix.scale_text) {
304-
scale = this._getTransform()[0];
305+
// We only use X axis as scale hint
306+
scale = this._matrix_decompose(this._getTransform()).scale[0];
305307
}
306308
else {
307309
scale = 1;
@@ -353,9 +355,11 @@
353355
this.path = origPath;
354356
}
355357

358+
var scale;
356359
var scale;
357360
if (this.pdf.hotfix && this.pdf.hotfix.scale_text) {
358-
scale = this._getTransform()[0];
361+
// We only use the X axis as scale hint
362+
scale = this._matrix_decompose(this._getTransform()).scale[0];
359363
}
360364
else {
361365
scale = 1;

0 commit comments

Comments
 (0)