diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-03-27 21:24:59 +0100 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-03-29 15:58:46 +0200 |
| commit | c34e01c63eea9fb97d8d4e93546d884b0294e475 (patch) | |
| tree | 078c5e28d93bc7c4dc6a6a4818d14a67713192aa /apps/web/src/components/editor/panels/properties/tabs/text-tab.tsx | |
| parent | 3e75852ffee06ec75006c787389870107395bd2d (diff) | |
| download | opencut-c34e01c63eea9fb97d8d4e93546d884b0294e475.tar.gz | |
refactor: clean up number formatting and step handling in property tabs
Diffstat (limited to 'apps/web/src/components/editor/panels/properties/tabs/text-tab.tsx')
| -rw-r--r-- | apps/web/src/components/editor/panels/properties/tabs/text-tab.tsx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/web/src/components/editor/panels/properties/tabs/text-tab.tsx b/apps/web/src/components/editor/panels/properties/tabs/text-tab.tsx index 45831dc0..be85bede 100644 --- a/apps/web/src/components/editor/panels/properties/tabs/text-tab.tsx +++ b/apps/web/src/components/editor/panels/properties/tabs/text-tab.tsx @@ -16,7 +16,7 @@ import { import { ColorPicker } from "@/components/ui/color-picker";
import { Button } from "@/components/ui/button";
import { uppercase } from "@/utils/string";
-import { clamp } from "@/utils/math";
+import { clamp, formatNumberForDisplay } from "@/utils/math";
import { useEditor } from "@/hooks/use-editor";
import { DEFAULT_COLOR } from "@/constants/project-constants";
import {
@@ -251,7 +251,10 @@ function SpacingSection({ });
const lineHeight = usePropertyDraft({
- displayValue: (element.lineHeight ?? DEFAULTS.text.lineHeight).toFixed(1),
+ displayValue: formatNumberForDisplay({
+ value: element.lineHeight ?? DEFAULTS.text.lineHeight,
+ fractionDigits: 1,
+ }),
parse: (input) => {
const parsed = parseFloat(input);
return Number.isNaN(parsed)
|
