summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorjaepark <jaepark@google.com>2016-08-01 18:07:21 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-01 18:07:21 -0700
commit2d7ab183976259dd9f428bfe3e10966fdd3e5f65 (patch)
treed1b8d00c7b351c2656598eedd67d4251d018f53f /core
parentca97a8ee99cad1ddb6a69e14cc7a501b3e8092a4 (diff)
downloadpdfium-2d7ab183976259dd9f428bfe3e10966fdd3e5f65.tar.xz
Support PDF highlight annotation with opacity.
BUG=62625 Review-Url: https://codereview.chromium.org/2202063002
Diffstat (limited to 'core')
-rw-r--r--core/fpdfdoc/cpvt_generateap.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp
index 56b6612717..13ef506158 100644
--- a/core/fpdfdoc/cpvt_generateap.cpp
+++ b/core/fpdfdoc/cpvt_generateap.cpp
@@ -538,8 +538,11 @@ bool CPVT_GenerateAP::GenerateHighlightAP(CPDF_Document* pDoc,
CPDF_Dictionary* pGSDict = new CPDF_Dictionary;
pGSDict->SetAtString("Type", "ExtGState");
- pGSDict->SetAtNumber("ca", 1);
- pGSDict->SetAtNumber("CA", 1);
+
+ FX_FLOAT fOpacity =
+ pAnnotDict->KeyExist("CA") ? pAnnotDict->GetNumberBy("CA") : 1;
+ pGSDict->SetAtNumber("ca", fOpacity);
+ pGSDict->SetAtNumber("CA", fOpacity);
pGSDict->SetAtBoolean("AIS", false);
pGSDict->SetAtString("BM", "Multiply");