summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-02-27 16:29:50 -0800
committerLei Zhang <thestig@chromium.org>2015-02-27 16:29:50 -0800
commit944ccad72d028ed5e37f53c5c8c0888866905bc3 (patch)
treee50698e58958ad7b9091c21cbe4eb5bc109e898c
parent5b47dbfe85e8db4122089afa6d00264f1e973af2 (diff)
downloadpdfium-944ccad72d028ed5e37f53c5c8c0888866905bc3.tar.xz
Do hit tests against Annots in reverse order.
BUG=chromium:445408 R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/952423002
-rw-r--r--core/src/fpdfdoc/doc_link.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/fpdfdoc/doc_link.cpp b/core/src/fpdfdoc/doc_link.cpp
index c27333e08b..964b84e549 100644
--- a/core/src/fpdfdoc/doc_link.cpp
+++ b/core/src/fpdfdoc/doc_link.cpp
@@ -56,7 +56,7 @@ CPDF_Link CPDF_LinkList::GetLinkAtPoint(CPDF_Page* pPage, FX_FLOAT pdf_x, FX_FLO
return NULL;
}
int size = pPageLinkList->GetSize();
- for (int i = 0; i < size; i ++) {
+ for (int i = size - 1; i >= 0; --i) {
CPDF_Link Link = (CPDF_Dictionary*)pPageLinkList->GetAt(i);
CPDF_Rect rect = Link.GetRect();
if (rect.Contains(pdf_x, pdf_y)) {