fix consecutive splits
This commit is contained in:
parent
7d801be682
commit
9d5391805d
1 changed files with 2 additions and 3 deletions
|
@ -49,9 +49,7 @@ export class SplitControls {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateControls() { // Update the markers when the files change
|
updateControls() { // Update the markers when the files change
|
||||||
|
|
||||||
let controlIndex = 0;
|
let controlIndex = 0;
|
||||||
|
|
||||||
applyToOrderedSelectedItemsFromFile((fileId, level, items) => {
|
applyToOrderedSelectedItemsFromFile((fileId, level, items) => {
|
||||||
let file = getFile(fileId);
|
let file = getFile(fileId);
|
||||||
|
|
||||||
|
@ -61,6 +59,7 @@ export class SplitControls {
|
||||||
for (let point of segment.trkpt.slice(1, -1)) { // Update the existing controls (could be improved by matching the existing controls with the new ones?)
|
for (let point of segment.trkpt.slice(1, -1)) { // Update the existing controls (could be improved by matching the existing controls with the new ones?)
|
||||||
if (point._data.anchor) {
|
if (point._data.anchor) {
|
||||||
if (controlIndex < this.controls.length) {
|
if (controlIndex < this.controls.length) {
|
||||||
|
this.controls[controlIndex].fileId = fileId;
|
||||||
this.controls[controlIndex].point = point;
|
this.controls[controlIndex].point = point;
|
||||||
this.controls[controlIndex].segment = segment;
|
this.controls[controlIndex].segment = segment;
|
||||||
this.controls[controlIndex].trackIndex = trackIndex;
|
this.controls[controlIndex].trackIndex = trackIndex;
|
||||||
|
@ -137,7 +136,7 @@ export class SplitControls {
|
||||||
|
|
||||||
marker.getElement().addEventListener('click', (e) => {
|
marker.getElement().addEventListener('click', (e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
dbUtils.split(fileId, trackIndex, segmentIndex, point.getCoordinates(), point._data.index);
|
dbUtils.split(control.fileId, control.trackIndex, control.segmentIndex, control.point.getCoordinates(), control.point._data.index);
|
||||||
});
|
});
|
||||||
|
|
||||||
return control;
|
return control;
|
||||||
|
|
Loading…
Reference in a new issue