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

Unified Diff: core/src/fpdfdoc/doc_form.cpp

Issue 958423005: Handle overlapping links and widgets. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 10 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 | « core/include/fpdfdoc/fpdf_doc.h ('k') | core/src/fpdfdoc/doc_link.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfdoc/doc_form.cpp
diff --git a/core/src/fpdfdoc/doc_form.cpp b/core/src/fpdfdoc/doc_form.cpp
index d695cb98bab8aa6087d163ca5512c24c8fe58a18..1c1966f6e471ce7619f58b9400cff0c2945b35b2 100644
--- a/core/src/fpdfdoc/doc_form.cpp
+++ b/core/src/fpdfdoc/doc_form.cpp
@@ -903,6 +903,14 @@ CPDF_FormControl* CPDF_InterForm::GetControlAtPoint(CPDF_Page* pPage, FX_FLOAT p
}
CPDF_FormControl* pControl;
if (!m_ControlMap.Lookup(pAnnot, (FX_LPVOID&)pControl)) {
+ // If there is a link that overlaps the widget, return NULL.
+ if (pAnnot->GetString("Subtype") == "Link") {
+ CPDF_Link link(pAnnot);
+ CPDF_Rect link_rect = link.GetRect();
+ if (link_rect.Contains(pdf_x, pdf_y)) {
+ return NULL;
+ }
+ }
continue;
}
CFX_FloatRect rect = pControl->GetRect();
« no previous file with comments | « core/include/fpdfdoc/fpdf_doc.h ('k') | core/src/fpdfdoc/doc_link.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698