diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-02-08 18:01:45 +0100 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-02-08 18:01:45 +0100 |
| commit | dc0b57cd6a5517dc6b57c6ebd1d0f6f7c8ee5e40 (patch) | |
| tree | 065b4428b3a92266e2e3ea9c24023149f48c60e9 /apps/web/src/components | |
| parent | a218a52d2d6ffa3d4b358d5a50e0816c16ebd51e (diff) | |
| download | opencut-dc0b57cd6a5517dc6b57c6ebd1d0f6f7c8ee5e40.tar.gz | |
refactor: replace text-specific update command with generic
Diffstat (limited to 'apps/web/src/components')
| -rw-r--r-- | apps/web/src/components/editor/panels/properties/text-properties.tsx | 30 |
1 files changed, 15 insertions, 15 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 8f40910b..43c1eb26 100644 --- a/apps/web/src/components/editor/panels/properties/text-properties.tsx +++ b/apps/web/src/components/editor/panels/properties/text-properties.tsx @@ -59,7 +59,7 @@ export function TextProperties({ const fontSize = Number.isNaN(parsed) ? element.fontSize : clamp({ value: parsed, min: MIN_FONT_SIZE, max: MAX_FONT_SIZE }); - editor.timeline.updateTextElement({ + editor.timeline.updateElement({ trackId, elementId: element.id, updates: { fontSize }, @@ -73,7 +73,7 @@ export function TextProperties({ ? element.fontSize : clamp({ value: parsed, min: MIN_FONT_SIZE, max: MAX_FONT_SIZE }); setFontSizeInput(fontSize.toString()); - editor.timeline.updateTextElement({ + editor.timeline.updateElement({ trackId, elementId: element.id, updates: { fontSize }, @@ -88,7 +88,7 @@ export function TextProperties({ const opacityPercent = Number.isNaN(parsed) ? Math.round(element.opacity * 100) : clamp({ value: parsed, min: 0, max: 100 }); - editor.timeline.updateTextElement({ + editor.timeline.updateElement({ trackId, elementId: element.id, updates: { opacity: opacityPercent / 100 }, @@ -102,7 +102,7 @@ export function TextProperties({ ? Math.round(element.opacity * 100) : clamp({ value: parsed, min: 0, max: 100 }); setOpacityInput(opacityPercent.toString()); - editor.timeline.updateTextElement({ + editor.timeline.updateElement({ trackId, elementId: element.id, updates: { opacity: opacityPercent / 100 }, @@ -113,7 +113,7 @@ export function TextProperties({ if (color !== "transparent") { lastSelectedColor.current = color; } - editor.timeline.updateTextElement({ + editor.timeline.updateElement({ trackId, elementId: element.id, updates: { backgroundColor: color }, @@ -126,7 +126,7 @@ export function TextProperties({ isTransparent: boolean; }) => { const newColor = isTransparent ? "transparent" : lastSelectedColor.current; - editor.timeline.updateTextElement({ + editor.timeline.updateElement({ trackId, elementId: element.id, updates: { backgroundColor: newColor }, @@ -154,7 +154,7 @@ export function TextProperties({ defaultValue={element.content} className="bg-panel-accent min-h-20" onChange={(e) => - editor.timeline.updateTextElement({ + editor.timeline.updateElement({ trackId, elementId: element.id, updates: { content: e.target.value }, @@ -167,7 +167,7 @@ export function TextProperties({ <FontPicker defaultValue={element.fontFamily} onValueChange={(value: FontFamily) => - editor.timeline.updateTextElement({ + editor.timeline.updateElement({ trackId, elementId: element.id, updates: { fontFamily: value }, @@ -186,7 +186,7 @@ export function TextProperties({ } size="sm" onClick={() => - editor.timeline.updateTextElement({ + editor.timeline.updateElement({ trackId, elementId: element.id, updates: { @@ -205,7 +205,7 @@ export function TextProperties({ } size="sm" onClick={() => - editor.timeline.updateTextElement({ + editor.timeline.updateElement({ trackId, elementId: element.id, updates: { @@ -228,7 +228,7 @@ export function TextProperties({ } size="sm" onClick={() => - editor.timeline.updateTextElement({ + editor.timeline.updateElement({ trackId, elementId: element.id, updates: { @@ -251,7 +251,7 @@ export function TextProperties({ } size="sm" onClick={() => - editor.timeline.updateTextElement({ + editor.timeline.updateElement({ trackId, elementId: element.id, updates: { @@ -279,7 +279,7 @@ export function TextProperties({ max={MAX_FONT_SIZE} step={1} onValueChange={([value]) => { - editor.timeline.updateTextElement({ + editor.timeline.updateElement({ trackId, elementId: element.id, updates: { fontSize: value }, @@ -310,7 +310,7 @@ export function TextProperties({ string: (element.color || "FFFFFF").replace("#", ""), })} onChange={(color) => { - editor.timeline.updateTextElement({ + editor.timeline.updateElement({ trackId, elementId: element.id, updates: { color: `#${color}` }, @@ -330,7 +330,7 @@ export function TextProperties({ max={100} step={1} onValueChange={([value]) => { - editor.timeline.updateTextElement({ + editor.timeline.updateElement({ trackId, elementId: element.id, updates: { opacity: value / 100 }, |
