tsgrp / OpenAnnotate

TSG's Browser-based Annotation Tool
8 stars 4 forks source link

Text redactions rectangles overlapping other text #796

Closed sambelcher1 closed 4 years ago

sambelcher1 commented 4 years ago

For certain documents when a redaction is created the box overlaps the line above/below it. When the redaction is saved it redacts the text on the targeted line as well as any text that was overlapped on other lines. A redaction should only remove the intended text and it should not overlap on any text that was not intended to be redacted.

A possible solution is to utilize a different method from any of the libraries that we currently use to grab that rectangle. There may be another method that would take into account any extra or removed spacing that is causing the rectangle to be bigger than we expect.

sambelcher1 commented 4 years ago

Closed with OC REV# 26201 and AEV REV #7041

REDACTION WORDMAPS: Fixed an issue with redactions being created too large sometimes and overlapping other text. This was caused by us intentionally creating wordmaps larger than we needed to in order to make other annotations like strike-out and underline look better. Now those annotations draw correctly halfway through the wordmap so we don't need to manipulate the wordmap rectangle in that way.

Redactions created through search were also intentionally created too large in order to make them more visible but this was causing the same issue. Removing the extra height set on them makes sure they still redact all of the text, but the saved redaction now looks like a much smaller line sometimes. If content is added to the comment of a redaction then the redacted area will always be the correct size to show that comment text.

Requires OC Commit #26201

CRs: kgarelli, aking

WORDMAP RECTANGLE SIZING: changed the rectangles for wordmaps created in pdfbox to only include the height of the text without any buffer. This was causing redactions to overlap other rectangles and redact two lines of text when only one should be. This change was originally implemented in order to make some annotations like strike-out and underline look better, but that is now handled in AEV instead.

CR: kgarelli, aking