feature:deselect-clips-on-click
This commit is contained in:
@ -299,9 +299,13 @@ export function Timeline() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleWheel = (e: React.WheelEvent) => {
|
const handleWheel = (e: React.WheelEvent) => {
|
||||||
e.preventDefault();
|
// Only zoom if user is using pinch gesture (ctrlKey or metaKey is true)
|
||||||
const delta = e.deltaY > 0 ? -0.05 : 0.05;
|
if (e.ctrlKey || e.metaKey) {
|
||||||
setZoomLevel((prev) => Math.max(0.1, Math.min(10, prev + delta)));
|
e.preventDefault();
|
||||||
|
const delta = e.deltaY > 0 ? -0.05 : 0.05;
|
||||||
|
setZoomLevel((prev) => Math.max(0.1, Math.min(10, prev + delta)));
|
||||||
|
}
|
||||||
|
// Otherwise, allow normal scrolling
|
||||||
};
|
};
|
||||||
|
|
||||||
const dragProps = {
|
const dragProps = {
|
||||||
@ -620,8 +624,7 @@ export function Timeline() {
|
|||||||
className="relative cursor-pointer select-none"
|
className="relative cursor-pointer select-none"
|
||||||
style={{
|
style={{
|
||||||
width: `${Math.max(1000, duration * 50 * zoomLevel)}px`,
|
width: `${Math.max(1000, duration * 50 * zoomLevel)}px`,
|
||||||
minHeight:
|
minHeight: '600px', // Always at least 600px tall for easy empty area clicking
|
||||||
tracks.length > 0 ? `${tracks.length * 60}px` : "200px",
|
|
||||||
}}
|
}}
|
||||||
onClick={handleTimelineAreaClick}
|
onClick={handleTimelineAreaClick}
|
||||||
onMouseDown={handleTimelineMouseDown}
|
onMouseDown={handleTimelineMouseDown}
|
||||||
|
Reference in New Issue
Block a user