File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -799,7 +799,9 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
799
799
this .applyTextTransforms ();
800
800
801
801
var lineWidth = current .lineWidth ;
802
- var scale = Math .abs (current .textMatrix [0 ] * fontMatrix [0 ]);
802
+ var a1 = current .textMatrix [0 ], b1 = current .textMatrix [1 ];
803
+ var a2 = fontMatrix [0 ], b2 = fontMatrix [1 ];
804
+ var scale = Math .sqrt ((a1 * a1 + b1 * b1 ) * (a2 * a2 + b2 * b2 ));
803
805
if (scale == 0 || lineWidth == 0 )
804
806
lineWidth = this .getSinglePixelWidth ();
805
807
else
@@ -1340,7 +1342,10 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
1340
1342
},
1341
1343
getSinglePixelWidth : function CanvasGraphics_getSinglePixelWidth (scale ) {
1342
1344
var inverse = this .ctx .mozCurrentTransformInverse ;
1343
- return Math .abs (inverse [0 ] + inverse [2 ]);
1345
+ // max of the current horizontal and vertical scale
1346
+ return Math .sqrt (Math .max (
1347
+ (inverse [0 ] * inverse [0 ] + inverse [1 ] * inverse [1 ]),
1348
+ (inverse [2 ] * inverse [2 ] + inverse [3 ] * inverse [3 ])));
1344
1349
}
1345
1350
};
1346
1351
You can’t perform that action at this time.
0 commit comments