Skip to content

Commit

Permalink
fix(pointcloud): Fix the calculation of redo & undo
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerwin-L committed Feb 21, 2023
1 parent 40a4ad6 commit d24909c
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,19 @@ export const useHistory = () => {
return;
}

const { pointCloudBoxList: newPointCloudBoxList = [], polygonList: newPolygonList = [] } = params;
const { pointCloudBoxList: newPointCloudBoxList = [], polygonList: newPolygonList = [] } =
params;

if (newPointCloudBoxList) {
if (pointCloudBoxList.length !== newPointCloudBoxList.length) {
setSelectedIDs();
}

const deletePointCloudList = pointCloudBoxList.filter(
(v) => newPointCloudBoxList.findIndex((d) => d.id === v.id) >= 0,
const deletePointCloudList = pointCloudBoxList.filter((v) =>
newPointCloudBoxList.every((d) => d.id !== v.id),
);
const addPointCloudList = newPointCloudBoxList.filter(
(v) => pointCloudBoxList.findIndex((d) => d.id !== v.id) >= 0,
const addPointCloudList = newPointCloudBoxList.filter((v) =>
pointCloudBoxList.every((d) => d.id !== v.id),
);

// Clear All Data
Expand Down

0 comments on commit d24909c

Please sign in to comment.