summaryrefslogtreecommitdiff
path: root/fpdfsdk/fsdk_mgr.cpp
diff options
context:
space:
mode:
authorjaepark <jaepark@google.com>2016-08-29 17:15:08 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-29 17:15:08 -0700
commit35512aa7e4acc3ceb9c6aef5d61eebfb4ae802af (patch)
tree18ad1447ba8a7d06f304e1418616d919eadbbf8c /fpdfsdk/fsdk_mgr.cpp
parent07f5fd57682700bcbba20f01d52a806676fd02ff (diff)
downloadpdfium-35512aa7e4acc3ceb9c6aef5d61eebfb4ae802af.tar.xz
Display content of the annotation when mouse hover.
Each annotation has its contents, and users should be able to see the contents. In this patch, PDFium creates a Popup annotation for each annotation and stores the author and the content. When a user mouse hover on the annotation, PDFium draws the corresponding Popup annotation and displays the content. Also, roll DEPS for testing/corpus to 5867fa6. BUG=62625 Review-Url: https://codereview.chromium.org/2273893002
Diffstat (limited to 'fpdfsdk/fsdk_mgr.cpp')
-rw-r--r--fpdfsdk/fsdk_mgr.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/fpdfsdk/fsdk_mgr.cpp b/fpdfsdk/fsdk_mgr.cpp
index 9f16098e12..fda00e0e6e 100644
--- a/fpdfsdk/fsdk_mgr.cpp
+++ b/fpdfsdk/fsdk_mgr.cpp
@@ -602,6 +602,8 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(FX_FLOAT pageX,
CPDFSDK_AnnotIterator annotIterator(this, false);
while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) {
CFX_FloatRect rc = pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot);
+ if (pSDKAnnot->GetAnnotSubtype() == "Popup")
+ continue;
if (rc.Contains(pageX, pageY))
return pSDKAnnot;
}
@@ -833,13 +835,13 @@ FX_BOOL CPDFSDK_PageView::OnLButtonUp(const CFX_FloatPoint& point,
FX_BOOL CPDFSDK_PageView::OnMouseMove(const CFX_FloatPoint& point, int nFlag) {
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
- if (CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y)) {
+ if (CPDFSDK_Annot* pFXAnnot = GetFXAnnotAtPoint(point.x, point.y)) {
if (m_CaptureWidget && m_CaptureWidget != pFXAnnot) {
m_bExitWidget = TRUE;
m_bEnterWidget = FALSE;
pAnnotHandlerMgr->Annot_OnMouseExit(this, m_CaptureWidget, nFlag);
}
- m_CaptureWidget = (CPDFSDK_Widget*)pFXAnnot;
+ m_CaptureWidget = pFXAnnot;
m_bOnWidget = TRUE;
if (!m_bEnterWidget) {
m_bEnterWidget = TRUE;