mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 13:43:03 -05:00
Add check for figma.mixed in fills
This commit is contained in:
parent
881a13fb15
commit
a78b98b5f5
1 changed files with 1 additions and 23 deletions
24
src/code.ts
24
src/code.ts
|
@ -49,7 +49,7 @@ function traverse(node): NodeData {
|
||||||
y: node.y,
|
y: node.y,
|
||||||
width: node.width,
|
width: node.width,
|
||||||
height: node.height,
|
height: node.height,
|
||||||
fills: node.fills
|
fills: node.fills === figma.mixed ? [] : node.fills //TODO: Support mixed fills
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.fills && Array.isArray(node.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") {
|
if (node.type == "TEXT") {
|
||||||
const styledTextSegments = node.getStyledTextSegments(["fontName", "fontSize", "fontWeight", "lineHeight", "letterSpacing", "fills"]);
|
const styledTextSegments = node.getStyledTextSegments(["fontName", "fontSize", "fontWeight", "lineHeight", "letterSpacing", "fills"]);
|
||||||
let font = {
|
let font = {
|
||||||
|
|
Loading…
Reference in a new issue