summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio D'Urso <fabiodurso@hotmail.it>2012-04-21 20:26:49 +0200
committerAlbert Astals Cid <aacid@kde.org>2012-04-23 21:14:51 +0200
commit7684c325929493ad9de01a891de0aef197e176dd (patch)
tree045075d4529edebfea8481592732152ff643baff
parent44cd46a6e04a87bd702dab4a662042f69f16c4ad (diff)
AnnotText: Always force 24x24 size with custom stamps, not only on first rendering
-rw-r--r--poppler/Annot.cc21
1 files changed, 12 insertions, 9 deletions
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 130b9bb7..06d08d53 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -2248,8 +2248,6 @@ void AnnotText::draw(Gfx *gfx, GBool printing) {
if (!isVisible (printing))
return;
- double rectx2 = rect->x2;
- double recty2 = rect->y2;
if (appearance.isNull()) {
ca = opacity;
@@ -2280,9 +2278,11 @@ void AnnotText::draw(Gfx *gfx, GBool printing) {
appearBuf->append (ANNOT_TEXT_AP_CIRCLE);
appearBuf->append ("Q\n");
+ // Force 24x24 rectangle
+ PDFRectangle fixedRect(rect->x1, rect->y1, rect->x1 + 24, rect->y1 + 24);
+ appearBBox = new AnnotAppearanceBBox(&fixedRect);
double bbox[4];
- bbox[0] = bbox[1] = 0;
- bbox[2] = bbox[3] = 24;
+ appearBBox->getBBoxRect(bbox);
if (ca == 1) {
createForm(bbox, gFalse, NULL, &appearance);
} else {
@@ -2296,15 +2296,18 @@ void AnnotText::draw(Gfx *gfx, GBool printing) {
createForm(bbox, gFalse, &resDict, &appearance);
}
delete appearBuf;
-
- rectx2 = rect->x1 + 24;
- recty2 = rect->y1 + 24;
}
// draw the appearance stream
appearance.fetch(xref, &obj);
- gfx->drawAnnot(&obj, (AnnotBorder *)NULL, color,
- rect->x1, rect->y1, rectx2, recty2);
+ if (appearBBox) {
+ gfx->drawAnnot(&obj, (AnnotBorder *)NULL, color,
+ appearBBox->getPageXMin(), appearBBox->getPageYMin(),
+ appearBBox->getPageXMax(), appearBBox->getPageYMax());
+ } else {
+ gfx->drawAnnot(&obj, (AnnotBorder *)NULL, color,
+ rect->x1, rect->y1, rect->x2, rect->y2);
+ }
obj.free();
}