Merge branch 'RED-7296' into 'master'
RED-7296: delete drawn rectangle upon deselect. See merge request redactmanager/red-ui!297
This commit is contained in:
commit
9a368bc8a0
@ -141,6 +141,11 @@ export class REDAnnotationManager {
|
|||||||
this.#manager.addEventListener('annotationSelected', (annotations: Annotation[], action: string) => {
|
this.#manager.addEventListener('annotationSelected', (annotations: Annotation[], action: string) => {
|
||||||
this.#logger.info('[PDF] Annotation selected: ', annotations, action);
|
this.#logger.info('[PDF] Annotation selected: ', annotations, action);
|
||||||
this.#annotationSelected$.next([annotations, action]);
|
this.#annotationSelected$.next([annotations, action]);
|
||||||
|
|
||||||
|
const annotation = annotations.length === 1 ? annotations[0] : undefined;
|
||||||
|
if (annotation && annotation.ToolName === AnnotationToolNames.AnnotationCreateRectangle && action === 'deselected') {
|
||||||
|
this.delete(annotation.Id);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user