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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 553453002: PDF Viewer - Show context menu for links on right click (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback (update GetLinkAtPosition()) Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 83c83f4fe439c59c8d971de0d1fbe68ba1d1fda5..8cc14bf76efa80ae1657422d7ff66de2bf3a21bd 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -1863,7 +1863,10 @@ std::string PDFiumEngine::GetSelectedText() {
std::string PDFiumEngine::GetLinkAtPosition(const pp::Point& point) {
int temp;
PDFiumPage::LinkTarget target;
- PDFiumPage::Area area = GetCharIndex(point, &temp, &temp, &target);
+ pp::Point point_in_page(
+ static_cast<int>((point.x() + position_.x()) / current_zoom_),
+ static_cast<int>((point.y() + position_.y()) / current_zoom_));
+ PDFiumPage::Area area = GetCharIndex(point_in_page, &temp, &temp, &target);
if (area == PDFiumPage::WEBLINK_AREA)
return target.url;
return std::string();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698