From 944ccad72d028ed5e37f53c5c8c0888866905bc3 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 27 Feb 2015 16:29:50 -0800 Subject: Do hit tests against Annots in reverse order. BUG=chromium:445408 R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/952423002 --- core/src/fpdfdoc/doc_link.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) { -- cgit v1.2.3