diff --git a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts index 9d77ff5f4..e8db1ca54 100644 --- a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts @@ -247,10 +247,8 @@ export class FilePreviewScreenComponent const nonRedactionEntries = annotations.filter( a => !bool(a.getCustomData('redaction')) || bool(a.getCustomData('changeLogRemoved')), ); - if (this._readableRedactionsService.active) { - this._readableRedactionsService.setAnnotationsColor(redactions, 'redactionColor'); - this._readableRedactionsService.setAnnotationsOpacity(redactions); - } + this._readableRedactionsService.setAnnotationsColor(redactions, 'redactionColor'); + this._readableRedactionsService.setAnnotationsOpacity(redactions); this._annotationManager.show(redactions); this._annotationManager.hide(nonRedactionEntries); this._suggestionsService.hideSuggestionsInPreview(redactions); diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/readable-redactions.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/readable-redactions.service.ts index 50e09f693..f4f7dec66 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/readable-redactions.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/readable-redactions.service.ts @@ -63,14 +63,11 @@ export class ReadableRedactionsService { (ctx: CanvasRenderingContext2D, pageMatrix, rotation, options) => { const annotation = options.annotation; ctx.globalCompositeOperation = 'source-over'; - - (options.annotation as any).Quads.forEach(q => { - const yMin = Math.min(q.y1, q.y2, q.y3, q.y4); - const height = Math.sqrt(Math.pow(q.x1 - q.x4, 2) + Math.pow(q.y1 - q.y4, 2)); - const width = Math.sqrt(Math.pow(q.x1 - q.x2, 2) + Math.pow(q.y1 - q.y2, 2)); - ctx.fillStyle = annotation.getCustomData('redactionColor'); - ctx.fillRect(q.x1, yMin, width, height); - }); + ctx.fillStyle = annotation.getCustomData('redactionColor'); + ctx.fillRect(annotation.getX(), annotation.getY(), annotation.getWidth(), annotation.getHeight()); + }, + { + generateAppearance: false, }, ); }