Skipping icons with non interger width/height

master
WolverinDEV 2020-08-24 10:33:41 +02:00
parent 7ea65b0c51
commit 0522e813b3
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "webpack-svg-sprite-generator", "name": "webpack-svg-sprite-generator",
"version": "1.0.15", "version": "1.0.16",
"description": "", "description": "",
"main": "plugin.js", "main": "plugin.js",
"types": "ts/index.d.ts", "types": "ts/index.d.ts",

View File

@ -294,6 +294,9 @@ export async function generateSprite(files: string[]) : Promise<GeneratedSprite>
if(isNaN(width) || isNaN(height)) { if(isNaN(width) || isNaN(height)) {
console.warn("Skipping SVG %s because of invalid bounds (Parsed: %d x %d, Values: %o).", file, width, height, rootAttributes["viewBox"].split(" ")); console.warn("Skipping SVG %s because of invalid bounds (Parsed: %d x %d, Values: %o).", file, width, height, rootAttributes["viewBox"].split(" "));
continue; continue;
} else if(Math.floor(width) !== width || Math.floor(height) !== height) {
console.warn("Skipping SVG %s because of an non interger height/width (%fx%f)", file, width, height);
continue;
} }
svg.bounds = { svg.bounds = {