mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
fix zoom out
This commit is contained in:
@@ -40,6 +40,7 @@ export const TIMELINE_CONSTANTS = {
|
|||||||
ZOOM_MIN: 0.1,
|
ZOOM_MIN: 0.1,
|
||||||
ZOOM_MAX: 50,
|
ZOOM_MAX: 50,
|
||||||
ZOOM_STEP: 0.1,
|
ZOOM_STEP: 0.1,
|
||||||
|
ZOOM_OUT_FACTOR: 4,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const TRACK_ICONS: Record<TrackType, React.ReactNode> = {
|
export const TRACK_ICONS: Record<TrackType, React.ReactNode> = {
|
||||||
|
|||||||
@@ -14,9 +14,7 @@ export function getTimelineZoomMin({
|
|||||||
const zoomToFit =
|
const zoomToFit =
|
||||||
safeContainerWidth /
|
safeContainerWidth /
|
||||||
(paddedDuration * TIMELINE_CONSTANTS.PIXELS_PER_SECOND);
|
(paddedDuration * TIMELINE_CONSTANTS.PIXELS_PER_SECOND);
|
||||||
|
const minZoom = zoomToFit / TIMELINE_CONSTANTS.ZOOM_OUT_FACTOR;
|
||||||
|
|
||||||
return Math.min(
|
return Math.min(TIMELINE_CONSTANTS.ZOOM_MAX, minZoom);
|
||||||
TIMELINE_CONSTANTS.ZOOM_MAX,
|
|
||||||
Math.max(TIMELINE_CONSTANTS.ZOOM_MIN, zoomToFit),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user