[poppler] poppler/Gfx.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 24 00:36:50 UTC 2020


 poppler/Gfx.cc |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit fb93776c423c166547d952bc199b14383a1d4d8d
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Nov 24 01:29:59 2020 +0100

    Fix Annot border when C is present but empty -> transparent
    
    Issue #993

diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 04b81e65..b8bf47ab 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -5062,7 +5062,6 @@ void Gfx::drawAnnot(Object *str, AnnotBorder *border, AnnotColor *aColor, double
     double formXMin, formYMin, formXMax, formYMax;
     double x, y, sx, sy, tx, ty;
     double m[6], bbox[4];
-    double r, g, b;
     GfxColor color;
     double *dash, *dash2;
     int dashLength;
@@ -5215,18 +5214,22 @@ void Gfx::drawAnnot(Object *str, AnnotBorder *border, AnnotColor *aColor, double
     }
 
     // draw the border
-    if (border && border->getWidth() > 0) {
+    if (border && border->getWidth() > 0 && (!aColor || aColor->getSpace() != AnnotColor::colorTransparent)) {
         if (state->getStrokeColorSpace()->getMode() != csDeviceRGB) {
             state->setStrokePattern(nullptr);
             state->setStrokeColorSpace(new GfxDeviceRGBColorSpace());
             out->updateStrokeColorSpace(state);
         }
-        if (aColor && (aColor->getSpace() == AnnotColor::colorRGB)) {
+        double r, g, b;
+        if (!aColor) {
+            r = g = b = 0;
+        } else if ((aColor->getSpace() == AnnotColor::colorRGB)) {
             const double *values = aColor->getValues();
             r = values[0];
             g = values[1];
             b = values[2];
         } else {
+            error(errUnimplemented, -1, "AnnotColor different than RGB and Transparent not supported");
             r = g = b = 0;
         };
         color.c[0] = dblToCol(r);


More information about the poppler mailing list