AI-native design editor. Open-source Figma alternative.
Don't clip content on group-like frames (resizeToFit)
Danila Poyarkov73668530b218
diff --git a/packages/core/src/kiwi/codec.ts b/packages/core/src/kiwi/codec.tsindex ccad25b34..32cacab06 100644--- a/packages/core/src/kiwi/codec.ts+++ b/packages/core/src/kiwi/codec.ts@@ -277,6 +277,7 @@ export interface NodeChange {// FrameclipsContent?: booleanframeMaskDisabled?: boolean+ resizeToFit?: boolean// VectorvectorData?: unknownfillGeometry?: Array<{ windingRule?: string; commandsBlob?: number }>diff --git a/packages/core/src/kiwi/kiwi-convert.ts b/packages/core/src/kiwi/kiwi-convert.tsindex 46004bf4c..22ec9c517 100644--- a/packages/core/src/kiwi/kiwi-convert.ts+++ b/packages/core/src/kiwi/kiwi-convert.ts@@ -605,7 +605,7 @@ export function nodeChangeToProps(expanded: true,autoRename: (nc.autoRename ?? true) as boolean,boundVariables: extractBoundVariables(nc),- clipsContent: nc.frameMaskDisabled === false,+ clipsContent: nc.frameMaskDisabled === false && nc.resizeToFit !== true,componentId: extractSymbolId(nc)}}diff --git a/tests/engine/fig-import.test.ts b/tests/engine/fig-import.test.tsindex 736de4ad3..fed4fe890 100644--- a/tests/engine/fig-import.test.ts+++ b/tests/engine/fig-import.test.ts@@ -391,3 +391,32 @@ describe('fig-import: component set detection', () => {expect(frame.type).toBe('FRAME')})})++describe('fig-import: clipsContent with resizeToFit', () => {+ test('regular FRAME with frameMaskDisabled=false clips content', () => {+ const graph = importNodeChanges([+ doc(), canvas(),+ node('FRAME', 10, 1, { frameMaskDisabled: false }),+ ])+ const frame = graph.getChildren(graph.getPages()[0].id)[0]+ expect(frame.clipsContent).toBe(true)+ })++ test('resizeToFit FRAME does not clip even with frameMaskDisabled=false', () => {+ const graph = importNodeChanges([+ doc(), canvas(),+ node('FRAME', 10, 1, { frameMaskDisabled: false, resizeToFit: true }),+ ])+ const frame = graph.getChildren(graph.getPages()[0].id)[0]+ expect(frame.clipsContent).toBe(false)+ })++ test('FRAME with frameMaskDisabled=true does not clip', () => {+ const graph = importNodeChanges([+ doc(), canvas(),+ node('FRAME', 10, 1, { frameMaskDisabled: true }),+ ])+ const frame = graph.getChildren(graph.getPages()[0].id)[0]+ expect(frame.clipsContent).toBe(false)+ })+})