File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -295,12 +295,14 @@ 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-
299- if ( this . updatingSide && this . updatingSide !== side && startTime !== undefined ) {
300- if ( this . updatingSide === 'start' ) {
301- newStart = startTime
302- } else {
303- newEnd = startTime
298+ const isRegionCreating = startTime !== undefined // startTime is passed when the region is being created.
299+ if ( isRegionCreating ) {
300+ if ( this . updatingSide && this . updatingSide !== side ) {
301+ if ( this . updatingSide === 'start' ) {
302+ newStart = startTime
303+ } else {
304+ newEnd = startTime
305+ }
304306 }
305307 }
306308
@@ -309,8 +311,8 @@ class SingleRegion extends EventEmitter<RegionEvents> implements Region {
309311 const length = newEnd - newStart
310312
311313 this . updatingSide = side
312-
313- if ( newStart <= newEnd && length >= this . minLength && length <= this . maxLength ) {
314+ const resizeValid = length >= this . minLength && length <= this . maxLength
315+ if ( newStart <= newEnd && ( resizeValid || isRegionCreating ) ) {
314316 this . start = newStart
315317 this . end = newEnd
316318
You can’t perform that action at this time.
0 commit comments