FIX: Đã fix cross-machine (v202608060700)

This commit is contained in:
2026-08-05 22:02:43 +07:00
parent e9f29e09ca
commit 454dd91f96
7 changed files with 79 additions and 15 deletions
+5 -3
View File
@@ -2675,6 +2675,7 @@ const WaveformLane = ({
// Check if hovering near right edge of a clip for time-stretching (Alt key required)
const toleranceSec = 8 / zoom;
const rightEdgeClip = clips.find(c => {
if (!c.buffer) return false;
const duration = c.buffer.duration / (c.speed || 1.0);
return Math.abs(time - (c.startTime + duration)) <= toleranceSec;
});
@@ -2725,7 +2726,7 @@ const WaveformLane = ({
return;
}
const hoveredClip = clips.find(c => time >= c.startTime && time < c.startTime + c.buffer.duration / (c.speed || 1.0));
const hoveredClip = clips.find(c => c.buffer && time >= c.startTime && time < c.startTime + c.buffer.duration / (c.speed || 1.0));
const isOverClip = !!hoveredClip;
if (activeTool === 'pen') {
canvasRef.current.style.cursor = isOverClip ? 'copy' : 'not-allowed';
@@ -2806,6 +2807,7 @@ const WaveformLane = ({
// Check if time-stretching (Alt + Right Edge)
const toleranceSec = 8 / zoom;
const rightEdgeClip = clips.find(c => {
if (!c.buffer) return false;
const duration = c.buffer.duration / (c.speed || 1.0);
return Math.abs(time - (c.startTime + duration)) <= toleranceSec;
});
@@ -2880,7 +2882,7 @@ const WaveformLane = ({
return;
}
const clickedClip = clips.find(c => time >= c.startTime && time < c.startTime + c.buffer.duration / (c.speed || 1.0));
const clickedClip = clips.find(c => c.buffer && time >= c.startTime && time < c.startTime + c.buffer.duration / (c.speed || 1.0));
// Set selected clip ID
if (clickedClip) {
@@ -3022,7 +3024,7 @@ const WaveformLane = ({
if (onEditMidiInTab) onEditMidiInTab(track.id, dblMidiHit.id);
return;
}
const clickedClip = clips.find(c => time >= c.startTime && time < c.startTime + c.buffer.duration / (c.speed || 1.0));
const clickedClip = clips.find(c => c.buffer && time >= c.startTime && time < c.startTime + c.buffer.duration / (c.speed || 1.0));
if (clickedClip) {
e.preventDefault();
e.stopPropagation();