AI-native design editor. Open-source Figma alternative.
Extract DEFAULT_STROKE_MITER_LIMIT constant
Danila Poyarkov123dbe491b49
diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.tsindex c301bb516..496be3a42 100644--- a/packages/core/src/constants.ts+++ b/packages/core/src/constants.ts@@ -30,6 +30,7 @@ export const PEN_PATH_STROKE_WIDTH = 2export const PARENT_OUTLINE_ALPHA = 0.5export const PARENT_OUTLINE_DASH = 4export const DEFAULT_FONT_SIZE = 14+export const DEFAULT_STROKE_MITER_LIMIT = 4export const LABEL_FONT_SIZE = 11export const SIZE_FONT_SIZE = 10diff --git a/packages/core/src/kiwi/fig-import.ts b/packages/core/src/kiwi/fig-import.tsindex 2ce585242..35036636d 100644--- a/packages/core/src/kiwi/fig-import.ts+++ b/packages/core/src/kiwi/fig-import.ts@@ -1,3 +1,4 @@+import { DEFAULT_STROKE_MITER_LIMIT } from '../constants'import { SceneGraph } from '../scene-graph'import { styleToWeight } from '../fonts'import { decodeVectorNetworkBlob } from '../vector'@@ -489,7 +490,7 @@ export function importNodeChanges(borderBottomWeight: (ext(nc).borderBottomWeight as number) ?? 0,borderLeftWeight: (ext(nc).borderLeftWeight as number) ?? 0,independentStrokeWeights: (ext(nc).borderStrokeWeightsIndependent as boolean) ?? false,- strokeMiterLimit: 4,+ strokeMiterLimit: DEFAULT_STROKE_MITER_LIMIT,minWidth: (ext(nc).minWidth as number) ?? null,maxWidth: (ext(nc).maxWidth as number) ?? null,minHeight: (ext(nc).minHeight as number) ?? null,diff --git a/packages/core/src/scene-graph.ts b/packages/core/src/scene-graph.tsindex 2b377b078..534b6f371 100644--- a/packages/core/src/scene-graph.ts+++ b/packages/core/src/scene-graph.ts@@ -1,3 +1,5 @@+import { DEFAULT_STROKE_MITER_LIMIT } from './constants'+export type { GUID, Color } from './types'export type HandleMirroring = 'NONE' | 'ANGLE' | 'ANGLE_AND_LENGTH'@@ -365,7 +367,7 @@ function createDefaultNode(type: NodeType, overrides: Partial<SceneNode> = {}):borderBottomWeight: 0,borderLeftWeight: 0,independentStrokeWeights: false,- strokeMiterLimit: 4,+ strokeMiterLimit: DEFAULT_STROKE_MITER_LIMIT,minWidth: null,maxWidth: null,minHeight: null,