Skip to content

Commit

Permalink
Eliminate Math.sign, which is unsupported in IE11. Fix #3814. (#3815)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauren Budorick authored Dec 16, 2016
1 parent a88d192 commit 41cdecd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/symbol/shaping.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 41cdecd

Please sign in to comment.