RED-7316: fixed imported redaction draw bug.

This commit is contained in:
Nicoleta Panaghiu 2024-01-15 11:09:30 +02:00
parent f614a3f0d4
commit 35f3ca2fd4

View File

@ -37,7 +37,7 @@ export class AnnotationDrawService {
async draw(annotations: List<AnnotationWrapper>, hideSkipped: boolean, dossierTemplateId: string) {
try {
return this._pdf.runWithCleanup(() => this.#draw(annotations, hideSkipped, dossierTemplateId));
await this.#draw(annotations, hideSkipped, dossierTemplateId);
} catch (e) {
console.error(e);
}
@ -165,6 +165,7 @@ export class AnnotationDrawService {
annotation.setCustomData('redact-manager', 'true');
annotation.setCustomData('redaction', String(annotationWrapper.isRedacted));
annotation.setCustomData('skipped', String(annotationWrapper.isSkipped));
annotation.setCustomData('imported', String(annotationWrapper.imported));
annotation.setCustomData('changeLog', String(annotationWrapper.isChangeLogEntry));
annotation.setCustomData('changeLogRemoved', String(annotationWrapper.isRemoved));
annotation.setCustomData('opacity', String(annotation.Opacity));
@ -175,12 +176,13 @@ export class AnnotationDrawService {
const appliedRedactionColor = this._defaultColorsService.getColor(dossierTemplateId, 'appliedRedactionColor');
annotation.setCustomData('appliedRedactionColor', String(appliedRedactionColor));
console.log(annotation);
return annotation;
}
#rectanglesToQuads(positions: IRectangle[], pageNumber: number): Quad[] {
const pageHeight = this._documentViewer.getHeight(pageNumber);
console.log(pageHeight);
return positions.map(p => this.#rectangleToQuad(p, pageHeight));
}