Extract DEFAULT_STROKE_MITER_LIMIT constant

This commit is contained in:
Danila Poyarkov 2026-03-01 13:53:25 +03:00 committed by Anton A S
parent fb03c84ecc
commit 484c3b6a9a
3 changed files with 6 additions and 2 deletions

View file

@ -30,6 +30,7 @@ export const PEN_PATH_STROKE_WIDTH = 2
export const PARENT_OUTLINE_ALPHA = 0.5
export const PARENT_OUTLINE_DASH = 4
export const DEFAULT_FONT_SIZE = 14
export const DEFAULT_STROKE_MITER_LIMIT = 4
export const LABEL_FONT_SIZE = 11
export const SIZE_FONT_SIZE = 10

View file

@ -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,

View file

@ -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,