summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Fella <nicolas.fella@kdab.com>2024-04-08 16:29:23 +0200
committerAlbert Astals Cid <aacid@kde.org>2024-04-08 21:59:48 +0000
commita4f034830da8045981523fdad9f54b545bfd529e (patch)
treeef3209ffe42f719318ff89f94d4ea62ac3164d1e
parent750bb558f094c8f25e53f212049fa83ee8f705b9 (diff)
Fix text position in drawSignatureFieldText
When centering vertically we calculate the y offset based on the height of the text and the annotation When doing that we must ignore the border width, otherwise the text is offset downwards
-rw-r--r--poppler/Annot.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 4e633fc5..a33951a7 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -5288,7 +5288,7 @@ void AnnotAppearanceBuilder::drawSignatureFieldText(const GooString &text, const
if (centerVertically) {
const double outTextHeight = textCommands.nLines * da.getFontPtSize();
if (outTextHeight < height) {
- yDelta -= (height - outTextHeight) / 2;
+ yDelta = height - (height - outTextHeight) / 2;
}
}
appendf("BT 1 0 0 1 {0:.2f} {1:.2f} Tm\n", leftMargin + textmargin, yDelta);