Commit 4f2a5c38 authored by rockyl's avatar rockyl

修改默认值

parent 05b0ebd5
......@@ -91,7 +91,7 @@ async function execute(psdFile, options) {
await walkNode(tree, async function (node, parent) {
let {name} = node;
const {x, y, width, height, alpha, visible, origin: {layer, layer: {typeTool, solidColor}}} = node;
console.log('walk node:', name);
//console.log('walk node:', name);
let properties = {
width, height, alpha, visible,
};
......@@ -108,7 +108,11 @@ async function execute(psdFile, options) {
let prefix = item[0];
let field = relativePosPrefixMap[prefix];
if (field) {
properties[field] = parseFloat(item.substr(1));
let value = parseFloat(item.substr(1));
if(isNaN(value)){
value = 0;
}
properties[field] = value;
}
}
}
......
This diff is collapsed.
......@@ -97,7 +97,7 @@ async function execute(psdFile, options) {
await walkNode(tree, async function (node, parent) {
let {name} = node;
const {x, y, width, height, alpha, visible, origin: {layer, layer: {typeTool, solidColor}}} = node;
console.log('walk node:', name);
//console.log('walk node:', name);
let properties = {
width, height, alpha, visible,
};
......@@ -114,7 +114,11 @@ async function execute(psdFile, options) {
let prefix = item[0];
let field = relativePosPrefixMap[prefix];
if (field) {
properties[field] = parseFloat(item.substr(1));
let value = parseFloat(item.substr(1));
if(isNaN(value)){
value = 0;
}
properties[field] = value;
}
}
}
......
This diff is collapsed.
......@@ -97,7 +97,7 @@
await walkNode(tree, async function (node, parent) {
let {name} = node;
const {x, y, width, height, alpha, visible, origin: {layer, layer: {typeTool, solidColor}}} = node;
console.log('walk node:', name);
//console.log('walk node:', name);
let properties = {
width, height, alpha, visible,
};
......@@ -114,7 +114,11 @@
let prefix = item[0];
let field = relativePosPrefixMap[prefix];
if (field) {
properties[field] = parseFloat(item.substr(1));
let value = parseFloat(item.substr(1));
if(isNaN(value)){
value = 0;
}
properties[field] = value;
}
}
}
......
This diff is collapsed.
......@@ -38,7 +38,7 @@ export async function execute(psdFile, options) {
await walkNode(tree, async function (node, parent) {
let {name} = node;
const {x, y, width, height, alpha, visible, origin: {layer, layer: {typeTool, solidColor}}} = node;
console.log('walk node:', name);
//console.log('walk node:', name);
let properties = {
width, height, alpha, visible,
};
......@@ -55,7 +55,11 @@ export async function execute(psdFile, options) {
let prefix = item[0];
let field = relativePosPrefixMap[prefix];
if (field) {
properties[field] = parseFloat(item.substr(1));
let value = parseFloat(item.substr(1));
if(isNaN(value)){
value = 0;
}
properties[field] = value;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment