diff --git a/src/pages/editor/components/sidebar/ObjectSettings.tsx b/src/pages/editor/components/sidebar/ObjectSettings.tsx index 250d6c3..2f6c6e1 100644 --- a/src/pages/editor/components/sidebar/ObjectSettings.tsx +++ b/src/pages/editor/components/sidebar/ObjectSettings.tsx @@ -24,8 +24,13 @@ type ObjectSettingsProps = { onDelete: (id: string) => void; }; -const roundNumbersDeep = (value: T): T => { +const DECIMAL_KEYS = new Set(["lineHeight"]); + +const roundNumbersDeep = (value: T, parentKey?: string): T => { if (typeof value === "number") { + if (parentKey && DECIMAL_KEYS.has(parentKey)) { + return value as T; + } return Math.round(value) as T; } @@ -35,7 +40,7 @@ const roundNumbersDeep = (value: T): T => { if (value && typeof value === "object") { const roundedObject = Object.entries(value).reduce>((acc, [key, nestedValue]) => { - acc[key] = roundNumbersDeep(nestedValue); + acc[key] = roundNumbersDeep(nestedValue, key); return acc; }, {});