mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-03 13:20:37 -05:00
fixes
This commit is contained in:
parent
e8e145d6bd
commit
18d1a5dab7
2 changed files with 17 additions and 2 deletions
|
@ -16,7 +16,11 @@ export const transformAutoLayout = (node: BaseFrameMixin): LayoutAttributes => {
|
||||||
return {
|
return {
|
||||||
layout: node.layoutMode !== 'NONE' ? 'flex' : undefined,
|
layout: node.layoutMode !== 'NONE' ? 'flex' : undefined,
|
||||||
layoutFlexDir: translateLayoutFlexDir(node.layoutMode),
|
layoutFlexDir: translateLayoutFlexDir(node.layoutMode),
|
||||||
layoutGap: translateLayoutGap(node.layoutMode, node.itemSpacing),
|
layoutGap: translateLayoutGap(
|
||||||
|
node.layoutMode,
|
||||||
|
node.itemSpacing,
|
||||||
|
node.primaryAxisAlignItems === 'SPACE_BETWEEN'
|
||||||
|
),
|
||||||
layoutWrapType: translateLayoutWrapType(node.layoutWrap),
|
layoutWrapType: translateLayoutWrapType(node.layoutWrap),
|
||||||
layoutPadding: translateLayoutPadding(node),
|
layoutPadding: translateLayoutPadding(node),
|
||||||
layoutJustifyContent: translateLayoutJustifyContent(node),
|
layoutJustifyContent: translateLayoutJustifyContent(node),
|
||||||
|
|
|
@ -25,7 +25,18 @@ export const translateLayoutFlexDir = (layoutMode: FigmaLayoutMode): LayoutFlexD
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const translateLayoutGap = (layoutMode: FigmaLayoutMode, itemSpacing: number): LayoutGap => {
|
export const translateLayoutGap = (
|
||||||
|
layoutMode: FigmaLayoutMode,
|
||||||
|
itemSpacing: number,
|
||||||
|
auto: boolean = false
|
||||||
|
): LayoutGap => {
|
||||||
|
if (auto) {
|
||||||
|
return {
|
||||||
|
rowGap: 0,
|
||||||
|
columnGap: 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
rowGap: layoutMode === 'VERTICAL' ? itemSpacing : 0,
|
rowGap: layoutMode === 'VERTICAL' ? itemSpacing : 0,
|
||||||
columnGap: layoutMode === 'HORIZONTAL' ? itemSpacing : 0
|
columnGap: layoutMode === 'HORIZONTAL' ? itemSpacing : 0
|
||||||
|
|
Loading…
Reference in a new issue