mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
fix: fix timeline width calculation for tick-based time
This commit is contained in:
@@ -50,7 +50,7 @@ import {
|
|||||||
getTimelineZoomMin,
|
getTimelineZoomMin,
|
||||||
getTimelinePaddingPx,
|
getTimelinePaddingPx,
|
||||||
} from "@/lib/timeline";
|
} from "@/lib/timeline";
|
||||||
import { BASE_TIMELINE_PIXELS_PER_SECOND } from "@/lib/timeline/scale";
|
import { timelineTimeToPixels } from "@/lib/timeline/pixel-utils";
|
||||||
import {
|
import {
|
||||||
getTrackHeight,
|
getTrackHeight,
|
||||||
getCumulativeHeightBefore,
|
getCumulativeHeightBefore,
|
||||||
@@ -340,8 +340,7 @@ export function Timeline() {
|
|||||||
|
|
||||||
const containerWidth =
|
const containerWidth =
|
||||||
tracksContainerRef.current?.clientWidth || FALLBACK_CONTAINER_WIDTH;
|
tracksContainerRef.current?.clientWidth || FALLBACK_CONTAINER_WIDTH;
|
||||||
const contentWidth =
|
const contentWidth = timelineTimeToPixels({ time: timelineDuration, zoomLevel });
|
||||||
timelineDuration * BASE_TIMELINE_PIXELS_PER_SECOND * zoomLevel;
|
|
||||||
const paddingPx = getTimelinePaddingPx({
|
const paddingPx = getTimelinePaddingPx({
|
||||||
containerWidth,
|
containerWidth,
|
||||||
zoomLevel,
|
zoomLevel,
|
||||||
|
|||||||
Reference in New Issue
Block a user