Skip to content

Commit 1e4549c

Browse files
committed
🐛 fix: fix position parsing
1 parent 8fc94dd commit 1e4549c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/function/nodeToGroup.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* eslint-disable no-console */
22
import nodeToLayers from './nodeToLayers';
3+
import { Group, Style } from '../models';
34
import { isNodeVisible } from '../utils/visibility';
45
import { getChildNodeList } from '../utils/hierarchy';
56
import { getName } from '../utils/name';
6-
import { Group, Style } from '../models';
77
import { isExistPseudoText, isExistPseudoShape } from '../utils/pseudo';
88
import { checkNoNull } from '../utils/utils';
99
import { AnyLayer } from '..';
@@ -79,6 +79,8 @@ const nodeToGroup = async (
7979
});
8080
console.groupEnd();
8181

82+
checkNoNull(group.frame);
83+
8284
if (
8385
group.layers.length === 1 &&
8486
(group.layers[0].class === 'rectangle' ||
@@ -98,7 +100,6 @@ const nodeToGroup = async (
98100
layer.y += group.y;
99101
layer.rotation += group.rotation;
100102

101-
checkNoNull(layer.toSketchJSON());
102103
return layer as Group;
103104
}
104105

@@ -124,7 +125,6 @@ const nodeToGroup = async (
124125
group.className = node.className;
125126
console.info('%c输出 Group 为:', 'font-weight:bold;color:#4590f7;', group);
126127

127-
checkNoNull(group.toSketchJSON());
128128
return group;
129129
};
130130

src/function/nodeToSketchSymbol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ export default async (node: Element, options?: NodeToSketchSymbolOptions) => {
7979
adjustSymbolParams(symbol, paramsList);
8080
});
8181

82-
checkNoNull(symbol.toSketchJSON());
82+
checkNoNull(symbol.frame);
8383
return symbol;
8484
};

0 commit comments

Comments
 (0)