Text highlight annotations

This commit is contained in:
Jakub Melka
2020-12-12 18:08:37 +01:00
parent dc55950050
commit a6ce36a00c
10 changed files with 1203 additions and 234 deletions

View File

@ -482,6 +482,13 @@ public:
/// \param matrix Matrix which translates from page space to device space
void draw(QPainter* painter, PDFInteger pageIndex, PDFTextLayoutGetter& textLayoutGetter, const QMatrix& matrix);
/// Prepares geometry for text selection drawing, using text layout and matrix. If current text selection
/// doesn't contain items from active page, then text layout is not accessed.
/// \param pageIndex Page index
/// \param textLayoutGetter Text layout getter
/// \param matrix Matrix which translates from page space to device space
QPainterPath prepareGeometry(PDFInteger pageIndex, PDFTextLayoutGetter& textLayoutGetter, const QMatrix& matrix, QPolygonF* quadrilaterals);
private:
static constexpr const PDFReal HEIGHT_INCREASE_FACTOR = 0.40;
static constexpr const PDFReal SELECTION_ALPHA = 0.25;