Skip to content

Commit

Permalink
fix viewBox round
Browse files Browse the repository at this point in the history
  • Loading branch information
caub committed Jun 14, 2017
1 parent 19e2c9a commit 8592d20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions plugins/cleanupNumericValues.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ exports.fn = function(item, params) {

if (item.hasAttr('viewBox')) {
var nums = item.attr('viewBox').value.split(/[ ,]/g);
item.attr('viewBox').value = nums.map(function(num) {
return +num.toFixed(floatPrecision);
item.attr('viewBox').value = nums.map(function(value) {
var num = +value;
return isNaN(num) ? value : +num.toFixed(floatPrecision);
}).join(' ');
}

Expand Down
4 changes: 2 additions & 2 deletions test/plugins/cleanupNumericValues.01.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8592d20

Please sign in to comment.