mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 13:43:03 -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 {
|
||||
layout: node.layoutMode !== 'NONE' ? 'flex' : undefined,
|
||||
layoutFlexDir: translateLayoutFlexDir(node.layoutMode),
|
||||
layoutGap: translateLayoutGap(node.layoutMode, node.itemSpacing),
|
||||
layoutGap: translateLayoutGap(
|
||||
node.layoutMode,
|
||||
node.itemSpacing,
|
||||
node.primaryAxisAlignItems === 'SPACE_BETWEEN'
|
||||
),
|
||||
layoutWrapType: translateLayoutWrapType(node.layoutWrap),
|
||||
layoutPadding: translateLayoutPadding(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 {
|
||||
rowGap: layoutMode === 'VERTICAL' ? itemSpacing : 0,
|
||||
columnGap: layoutMode === 'HORIZONTAL' ? itemSpacing : 0
|
||||
|
|
Loading…
Reference in a new issue