Skip to content

Commit

Permalink
feat: ✨ Prevent selection of hidden nodes (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 committed Aug 13, 2024
1 parent cf5a032 commit 93884da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/utils/nodeTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ function shouldIncludeNode(
if (node.characters.trim().length === 0) {
return false;
}
if (!node.visible) {
return false;
}
return true;
}

export const findTextNodes = (nodes: readonly SceneNode[]): TextNode[] => {
const documentSettings = getDocumentData();
const result: TextNode[] = [];
for (const node of nodes) {
if (!node.visible) {
continue;
}

if (node.type === "TEXT") {
if (shouldIncludeNode(node, documentSettings)) {
result.push(node);
Expand Down

0 comments on commit 93884da

Please sign in to comment.