fix zoom out
This commit is contained in:
parent
b6a8b67753
commit
20f16aa2b4
|
|
@ -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),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue