Skip to content

Commit

Permalink
fix(image-annotator-react): fix redo undo(accomplish) #506
Browse files Browse the repository at this point in the history
  • Loading branch information
gary-Shen committed Oct 24, 2024
1 parent 33f0567 commit 939a9a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/image-annotator-react/src/ImageAnnotator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@ function ForwardAnnotator(
imageAnnotations![toolName]!.push(_item as AnnotationDataInUI);
}
});

Object.keys(imageAnnotations).forEach((key) => {
engine?.loadData(key as ToolName, imageAnnotations[key as ToolName] as AnnotationToolData<ToolName>);
});
},
[engine],
);
Expand Down Expand Up @@ -415,6 +419,8 @@ function ForwardAnnotator(
onUndo: onRedoUndo,
});

console.log('annotationsWithGlobal', annotationsWithGlobal);

const onAnnotationClear = useCallback(() => {
engine?.clearData();
updateAnnotationsWithGlobal(() => {
Expand Down

0 comments on commit 939a9a6

Please sign in to comment.