Merge branch 'RED-8753' into 'master'

RED-8753: fixed images disappearing upon aborting resize.

See merge request redactmanager/red-ui!343
This commit is contained in:
Dan Percic 2024-03-14 13:55:00 +01:00
commit 89fce1cfc0

View File

@ -140,12 +140,16 @@ export class REDAnnotationManager {
#listenForAnnotationSelected() {
this.#manager.addEventListener('annotationSelected', (annotations: Annotation[], action: string) => {
this.#logger.info('[PDF] Annotation selected: ', annotations, action);
this.#annotationSelected$.next([annotations, action]);
const annotation = annotations.length === 1 ? annotations[0] : undefined;
if (annotation && annotation.ToolName === AnnotationToolNames.AnnotationCreateRectangle && action === 'deselected') {
if (
annotation &&
annotation.ToolName === AnnotationToolNames.AnnotationCreateRectangle &&
action === 'deselected' &&
!this.resizingAnnotationId
) {
this.delete(annotation.Id);
}
this.#annotationSelected$.next([annotations, action]);
});
}