MCPcopy
hub / github.com/CapSoftware/Cap / clampTimelineHeight

Function clampTimelineHeight

apps/desktop/src/routes/editor/Editor.tsx:399–409  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

397 } | null>(null);
398
399 const clampTimelineHeight = (value: number) => {
400 const available = layoutBounds.height ?? 0;
401 const maxHeight =
402 available > 0
403 ? Math.max(MIN_TIMELINE_HEIGHT, available - MIN_PLAYER_HEIGHT)
404 : Number.POSITIVE_INFINITY;
405 const upperBound = Number.isFinite(maxHeight)
406 ? maxHeight
407 : Math.max(value, MIN_TIMELINE_HEIGHT);
408 return Math.min(Math.max(value, MIN_TIMELINE_HEIGHT), upperBound);
409 };
410
411 const timelineHeight = createMemo(() =>
412 Math.round(clampTimelineHeight(storedTimelineHeight())),

Callers 2

InnerFunction · 0.85
handleMoveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected