From 41cdecdb461149df54e0c81f97ec9d9fa0c3b6b7 Mon Sep 17 00:00:00 2001 From: Lauren Budorick Date: Thu, 15 Dec 2016 17:53:27 -0800 Subject: [PATCH] Eliminate Math.sign, which is unsupported in IE11. Fix #3814. (#3815) --- js/symbol/shaping.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/symbol/shaping.js b/js/symbol/shaping.js index 611edeba9ca..f88b60361e5 100644 --- a/js/symbol/shaping.js +++ b/js/symbol/shaping.js @@ -112,7 +112,7 @@ function calculateBadness(lineWidth, targetWidth, penalty, isLastBreak) { // Be more tolerant of short final lines return Math.max(0, raggedness - 150); } - return raggedness + (Math.sign(penalty) * Math.pow(penalty, 2)); + return raggedness + Math.abs(penalty) * penalty; } function calculatePenalty(codePoint, previousCodePoint) {