mirror of
https://github.com/svg/svgo.git
synced 2025-07-29 20:21:14 +03:00
fix viewBox round
This commit is contained in:
@ -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(' ');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user