Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hug in frames.2 #177

Merged
merged 2 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugin-src/transformers/partials/transformLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions plugin-src/translators/translateLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
};