Commit d245d8f 1 parent 3e7980f commit d245d8f Copy full SHA for d245d8f
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 @@ -447,7 +447,7 @@ export const TrackEditionLeftPanel: FC = () => {
447
447
}
448
448
setState ( {
449
449
...state ,
450
- track : { ... ( checkedTrack as TrackSectionEntity ) } ,
450
+ track : checkedTrack as TrackSectionEntity ,
451
451
} ) ;
452
452
} }
453
453
>
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