fixed unnecesary redraws
This commit is contained in:
parent
86de4f2040
commit
d323bbcb96
@ -165,7 +165,9 @@ export class FilePreviewScreenComponent implements OnInit {
|
||||
openManualRedactionDialog($event: ManualRedactionEntryWrapper) {
|
||||
this.ngZone.run(() => {
|
||||
this._dialogRef = this._dialogService.openManualRedactionDialog($event, (response: ManualAnnotationResponse) => {
|
||||
this._cleanupAndRedrawManualAnnotations();
|
||||
if (response?.annotationId) {
|
||||
this._cleanupAndRedrawManualAnnotations(response.annotationId);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -366,13 +368,13 @@ export class FilePreviewScreenComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
private _cleanupAndRedrawManualAnnotations(singleAnnotation?: AnnotationWrapper) {
|
||||
private _cleanupAndRedrawManualAnnotations(annotationIdToDraw?: string) {
|
||||
this._fileDownloadService.loadActiveFileManualAnnotations().subscribe((manualRedactions) => {
|
||||
this.fileData.manualRedactions = manualRedactions;
|
||||
this._rebuildFilters();
|
||||
this._annotationDrawService.drawAnnotations(
|
||||
this.instance,
|
||||
this.annotations.filter((item) => (singleAnnotation ? singleAnnotation.id === item.id && singleAnnotation.shouldDraw : item.shouldDraw))
|
||||
this.annotations.filter((item) => (annotationIdToDraw ? item.id === annotationIdToDraw && item.shouldDraw : item.shouldDraw))
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -382,7 +384,7 @@ export class FilePreviewScreenComponent implements OnInit {
|
||||
if (viewerAnnotation) {
|
||||
this.activeViewer.annotManager.deleteAnnotation(viewerAnnotation, true, true);
|
||||
}
|
||||
this._cleanupAndRedrawManualAnnotations(annotation);
|
||||
this._cleanupAndRedrawManualAnnotations(annotation.id);
|
||||
}
|
||||
|
||||
async fileActionPerformed(action: string) {
|
||||
|
||||
@ -12,8 +12,9 @@ export class AnnotationDrawService {
|
||||
constructor(private readonly _appStateService: AppStateService) {}
|
||||
|
||||
public drawAnnotations(activeViewer: WebViewerInstance, annotationWrappers: AnnotationWrapper[]) {
|
||||
annotationWrappers.forEach((mre) => {
|
||||
this.drawAnnotation(activeViewer, mre);
|
||||
annotationWrappers.forEach((annotation) => {
|
||||
console.log('draw', annotation);
|
||||
this.drawAnnotation(activeViewer, annotation);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user