mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 05:33:02 -05:00
🐛 Support invisible fills by setting opacity to 0
This supports invisible fills in Figma by setting their opacity to 0 when exporting to Penpot. Closes GH-17. Signed-off-by: Ryan Breen <rbreen@zmags.com>
This commit is contained in:
parent
ac443b7047
commit
c98236ef4e
1 changed files with 10 additions and 1 deletions
11
src/ui.tsx
11
src/ui.tsx
|
@ -99,6 +99,13 @@ export default class PenpotExporter extends React.Component<PenpotExporterProps,
|
|||
let penpotFill = null;
|
||||
for (var fill of fills){
|
||||
penpotFill = this.translateFill(fill, width, height);
|
||||
|
||||
// Penpot does not track fill visibility, so if the Figma fill is invisible we
|
||||
// force opacity to 0
|
||||
if (fill.visible === false){
|
||||
penpotFill.fillOpacity = 0;
|
||||
}
|
||||
|
||||
if (penpotFill !== null){
|
||||
penpotFills.unshift(penpotFill);
|
||||
}
|
||||
|
@ -115,7 +122,9 @@ export default class PenpotExporter extends React.Component<PenpotExporterProps,
|
|||
}
|
||||
|
||||
createPenpotBoard(file, node, baseX, baseY){
|
||||
file.addArtboard({ name: node.name, x: node.x + baseX, y: node.y + baseY, width: node.width, height: node.height });
|
||||
file.addArtboard({ name: node.name, x: node.x + baseX, y: node.y + baseY, width: node.width, height: node.height,
|
||||
fills: this.translateFills(node.fills, node.width, node.height)
|
||||
});
|
||||
for (var child of node.children){
|
||||
this.createPenpotItem(file, child, node.x + baseX, node.y + baseY);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue