From 8eb2b1a1be891d3b14d8644fd673d178679d3ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20S=C3=A1nchez?= Date: Tue, 18 Jun 2024 16:00:39 +0200 Subject: [PATCH] fixes (#177) --- plugin-src/transformers/partials/transformLayout.ts | 2 +- plugin-src/translators/translateLayout.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin-src/transformers/partials/transformLayout.ts b/plugin-src/transformers/partials/transformLayout.ts index 1882d7d..dde5824 100644 --- a/plugin-src/transformers/partials/transformLayout.ts +++ b/plugin-src/transformers/partials/transformLayout.ts @@ -45,7 +45,7 @@ export const transformLayoutAttributes = ( > => { return { 'layoutItemH-Sizing': translateLayoutSizing(node.layoutSizingHorizontal, isFrame), - 'layoutItemV-Sizing': translateLayoutSizing(node.layoutSizingVertical), + 'layoutItemV-Sizing': translateLayoutSizing(node.layoutSizingVertical, isFrame), 'layoutItemAbsolute': node.layoutPositioning === 'ABSOLUTE', 'layoutItemMaxH': node.maxHeight ?? undefined, 'layoutItemMinH': node.minHeight ?? undefined, diff --git a/plugin-src/translators/translateLayout.ts b/plugin-src/translators/translateLayout.ts index 238ef92..1bb73a4 100644 --- a/plugin-src/translators/translateLayout.ts +++ b/plugin-src/translators/translateLayout.ts @@ -123,8 +123,8 @@ export const translateLayoutSizing = ( case 'FIXED': return 'fix'; case 'HUG': - return isFrame ? 'fix' : 'auto'; // @TODO: Penpot does not handle hug in frames as figma does + return 'auto'; case 'FILL': - return 'fill'; + return isFrame ? 'fix' : 'fill'; // @TODO: Penpot does not handle fill in frames as figma does } };