From 9cbac23607b160ca2dda1f8c1ddc45a244ea7b87 Mon Sep 17 00:00:00 2001 From: Steven Spungin Date: Wed, 15 Mar 2017 12:20:55 -0400 Subject: [PATCH] Fix scale calculation when text is rotated --- plugins/context2d.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/context2d.js b/plugins/context2d.js index 71bd66d33..e97122a9b 100644 --- a/plugins/context2d.js +++ b/plugins/context2d.js @@ -299,9 +299,11 @@ this.path = origPath; } + var scale; var scale; if (this.pdf.hotfix && this.pdf.hotfix.scale_text) { - scale = this._getTransform()[0]; + // We only use X axis as scale hint + scale = this._matrix_decompose(this._getTransform()).scale[0]; } else { scale = 1; @@ -353,9 +355,11 @@ this.path = origPath; } + var scale; var scale; if (this.pdf.hotfix && this.pdf.hotfix.scale_text) { - scale = this._getTransform()[0]; + // We only use the X axis as scale hint + scale = this._matrix_decompose(this._getTransform()).scale[0]; } else { scale = 1;