Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2502)

Unified Diff: core/fpdfdoc/cpvt_generateap.cpp

Issue 2202063002: Support PDF highlight annotation with opacity. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Support highlight annotation with opacity. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpvt_generateap.cpp
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp
index 56b661271702cb5e3f6ad2c75f6ccad1b58d056a..13ef5061580a90beefb2cc89a169a34a74c25e04 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");
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698