summaryrefslogtreecommitdiff
path: root/apps/web/src/components/editor/panels/properties
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-02-08 16:50:31 +0100
committerMaze Winther <mazewinther@gmail.com>2026-02-08 16:50:31 +0100
commitc6666fd385588f11d6ec887455a115d525e2e6c2 (patch)
tree08a142946f27eb70854a791165cd00ad9693678c /apps/web/src/components/editor/panels/properties
parent9b5fd6eb077a3fb2380f42414b65405030a01fcd (diff)
downloadopencut-c6666fd385588f11d6ec887455a115d525e2e6c2.tar.gz
feat: update text properties to use dynamic font size limits and scaling
Diffstat (limited to 'apps/web/src/components/editor/panels/properties')
-rw-r--r--apps/web/src/components/editor/panels/properties/text-properties.tsx13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/web/src/components/editor/panels/properties/text-properties.tsx b/apps/web/src/components/editor/panels/properties/text-properties.tsx
index f8c9bf87..8f40910b 100644
--- a/apps/web/src/components/editor/panels/properties/text-properties.tsx
+++ b/apps/web/src/components/editor/panels/properties/text-properties.tsx
@@ -30,6 +30,7 @@ import {
} from "@/components/ui/tooltip";
import { useEditor } from "@/hooks/use-editor";
import { DEFAULT_COLOR } from "@/constants/project-constants";
+import { MIN_FONT_SIZE, MAX_FONT_SIZE } from "@/constants/text-constants";
export function TextProperties({
element,
@@ -57,7 +58,7 @@ export function TextProperties({
const parsed = parseInt(value, 10);
const fontSize = Number.isNaN(parsed)
? element.fontSize
- : clamp({ value: parsed, min: 8, max: 300 });
+ : clamp({ value: parsed, min: MIN_FONT_SIZE, max: MAX_FONT_SIZE });
editor.timeline.updateTextElement({
trackId,
elementId: element.id,
@@ -70,7 +71,7 @@ export function TextProperties({
const parsed = parseInt(fontSizeInput, 10);
const fontSize = Number.isNaN(parsed)
? element.fontSize
- : clamp({ value: parsed, min: 8, max: 300 });
+ : clamp({ value: parsed, min: MIN_FONT_SIZE, max: MAX_FONT_SIZE });
setFontSizeInput(fontSize.toString());
editor.timeline.updateTextElement({
trackId,
@@ -274,8 +275,8 @@ export function TextProperties({
<div className="flex items-center gap-2">
<Slider
value={[element.fontSize]}
- min={8}
- max={300}
+ min={MIN_FONT_SIZE}
+ max={MAX_FONT_SIZE}
step={1}
onValueChange={([value]) => {
editor.timeline.updateTextElement({
@@ -290,8 +291,8 @@ export function TextProperties({
<Input
type="number"
value={fontSizeInput}
- min={8}
- max={300}
+ min={MIN_FONT_SIZE}
+ max={MAX_FONT_SIZE}
onChange={(e) =>
handleFontSizeChange({ value: e.target.value })
}