Skip to content

Commit

Permalink
Fix: Set value when at least one shape is filled
Browse files Browse the repository at this point in the history
  • Loading branch information
JohJakob committed Jul 17, 2022
1 parent b1fd6e7 commit a12f61b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/code.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import clone from './clone';

let madeFilled = false;

const makeFilled = (selection) => {
const fallbackColor = {r: 0, g: 0, b:0};

for (const node of selection) {
let strokes;
let madeFilled = false;

// Only process visible nodes
if (node.visible) {
Expand Down Expand Up @@ -66,6 +67,8 @@ const makeFilled = (selection) => {
if (figma.command === "make_filled_and_flatten") {
figma.flatten([boolNode]);
}

madeFilled = true;
} else if (node.type === "BOOLEAN_OPERATION" || node.type === "COMPONENT" || node.type === "FRAME" || node.type === "GROUP" || node.type === "INSTANCE") {
// Process the children of boolean operation nodes, components, frames, groups, and instances
makeFilled(node.children);
Expand Down

0 comments on commit a12f61b

Please sign in to comment.