0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 05:33:02 -05:00

Add check for figma.mixed in fills

This commit is contained in:
Pablo Alba 2022-10-26 13:01:58 +02:00
parent 881a13fb15
commit a78b98b5f5

View file

@ -49,7 +49,7 @@ function traverse(node): NodeData {
y: node.y,
width: node.width,
height: node.height,
fills: node.fills
fills: node.fills === figma.mixed ? [] : node.fills //TODO: Support mixed fills
}
if (node.fills && Array.isArray(node.fills)){
@ -68,28 +68,6 @@ function traverse(node): NodeData {
}
}
//TODO Fix text segments with https://www.figma.com/plugin-docs/api/properties/TextNode-getstyledtextsegments
const defaultFontName = {
"family": "Inter",
"style": "Regular"
}
const defaultFontSize = 12;
const defaultFontWeight = 400
const defaultLineHeight = {
"unit": "AUTO"
};
const defaultLetterSpacing = {
"unit": "PERCENT",
"value": 0
}
const defaultTextAlignHorizontal = "LEFT";
const defaultTextAlignVertical = "TOP";
if (node.type == "TEXT") {
const styledTextSegments = node.getStyledTextSegments(["fontName", "fontSize", "fontWeight", "lineHeight", "letterSpacing", "fills"]);
let font = {