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/masks-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/masks-tab.tsx')
| -rw-r--r-- | apps/web/src/components/editor/panels/properties/tabs/masks-tab.tsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/web/src/components/editor/panels/properties/tabs/masks-tab.tsx b/apps/web/src/components/editor/panels/properties/tabs/masks-tab.tsx index 6a5d0d0b..db8bd728 100644 --- a/apps/web/src/components/editor/panels/properties/tabs/masks-tab.tsx +++ b/apps/web/src/components/editor/panels/properties/tabs/masks-tab.tsx @@ -38,7 +38,12 @@ import { TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip"; -import { clamp, formatNumberForDisplay, snapToStep } from "@/utils/math"; +import { + clamp, + formatNumberForDisplay, + getFractionDigitsForStep, + snapToStep, +} from "@/utils/math"; import { Section, SectionContent, @@ -599,7 +604,7 @@ function MaskNumberField({ const max = isPercent ? 100 : param.max; const step = isPercent ? 1 : param.step; const displayValue = value * displayMultiplier; - const maxFractionDigits = step >= 1 ? 0 : Math.round(-Math.log10(step)); + const maxFractionDigits = getFractionDigitsForStep({ step }); const clampDisplay = (nextDisplayValue: number) => max !== undefined |
