diff options
author | Albert Astals Cid <aacid@kde.org> | 2020-11-24 01:29:59 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2020-11-24 01:29:59 +0100 |
commit | fb93776c423c166547d952bc199b14383a1d4d8d (patch) | |
tree | 85d00dc40a3426b1bc8531ae5a979f21a6224f3d | |
parent | aaf2e8083141fcea5dacbc6af6a679533ad8dc55 (diff) |
Fix Annot border when C is present but empty -> transparent
Issue #993
-rw-r--r-- | poppler/Gfx.cc | 9 |
1 files changed, 6 insertions, 3 deletions
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); |