File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -295,7 +295,6 @@ class SingleRegion extends EventEmitter<RegionEvents> implements Region {
295295 const deltaSeconds = ( dx / width ) * this . totalDuration
296296 let newStart = ! side || side === 'start' ? this . start + deltaSeconds : this . start
297297 let newEnd = ! side || side === 'end' ? this . end + deltaSeconds : this . end
298- const length = newEnd - newStart
299298
300299 if ( this . updatingSide && this . updatingSide !== side && startTime !== undefined ) {
301300 if ( this . updatingSide === 'start' ) {
@@ -305,15 +304,13 @@ class SingleRegion extends EventEmitter<RegionEvents> implements Region {
305304 }
306305 }
307306
307+ newStart = Math . max ( 0 , newStart )
308+ newEnd = Math . min ( this . totalDuration , newEnd )
309+ const length = newEnd - newStart
310+
308311 this . updatingSide = side
309312
310- if (
311- newStart >= 0 &&
312- newEnd <= this . totalDuration &&
313- newStart <= newEnd &&
314- length >= this . minLength &&
315- length <= this . maxLength
316- ) {
313+ if ( newStart <= newEnd && length >= this . minLength && length <= this . maxLength ) {
317314 this . start = newStart
318315 this . end = newEnd
319316
You can’t perform that action at this time.
0 commit comments