0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-21 21:23:06 -05:00

Merge pull request #18 from ryanbreen/GH-17-invisible-fill-support

🐛 Support invisible fills by setting opacity to 0
This commit is contained in:
Alejandro 2023-01-10 07:41:53 +01:00 committed by GitHub
commit 6937cd8f12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}