Commit e2016ed 1 parent 91adabb commit e2016ed Copy full SHA for e2016ed
File tree 2 files changed +3
-2
lines changed
front/src/applications/editor/tools/trackEdition
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -442,7 +442,7 @@ export const TrackEditionLeftPanel: FC = () => {
442
442
}
443
443
setState ( {
444
444
...state ,
445
- track : { ... ( checkedTrack as TrackSectionEntity ) } ,
445
+ track : checkedTrack as TrackSectionEntity ,
446
446
} ) ;
447
447
} }
448
448
>
Original file line number Diff line number Diff line change @@ -33,11 +33,12 @@ export function injectGeometry(track: EditorEntity): EditorEntity {
33
33
34
34
/**
35
35
* Remove the invalid ranges when the length of the track section has been modified
36
+ * - keep ranges if begin is undefined in case we just added a new one or if we deleted the begin input value
36
37
* - remove ranges which start after the new end
37
38
* - cut the ranges which start before the new end but end after it
38
39
*/
39
40
export function removeInvalidRanges < T > ( values : LinearMetadataItem < T > [ ] , newLength : number ) {
40
41
return values
41
- . filter ( ( item ) => item . begin < newLength )
42
+ . filter ( ( item ) => item . begin < newLength || ! item . begin )
42
43
. map ( ( item ) => ( item . end >= newLength ? { ...item , end : newLength } : item ) ) ;
43
44
}
You can’t perform that action at this time.
0 commit comments