summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/cpwl_scroll_bar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/pdfwindow/cpwl_scroll_bar.cpp')
-rw-r--r--fpdfsdk/pdfwindow/cpwl_scroll_bar.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/fpdfsdk/pdfwindow/cpwl_scroll_bar.cpp b/fpdfsdk/pdfwindow/cpwl_scroll_bar.cpp
index 9b65cf1695..94ac2e6178 100644
--- a/fpdfsdk/pdfwindow/cpwl_scroll_bar.cpp
+++ b/fpdfsdk/pdfwindow/cpwl_scroll_bar.cpp
@@ -1051,19 +1051,12 @@ void CPWL_ScrollBar::OnPosButtonMouseMove(const CFX_PointF& point) {
}
void CPWL_ScrollBar::NotifyScrollWindow() {
- if (CPWL_Wnd* pParent = GetParentWindow()) {
- float fPos;
- switch (m_sbType) {
- case SBT_HSCROLL:
- fPos = m_OriginInfo.fContentMin + m_sData.fScrollPos;
- break;
- case SBT_VSCROLL:
- fPos = m_OriginInfo.fContentMax - m_sData.fScrollPos;
- break;
- }
- pParent->OnNotify(this, PNM_SCROLLWINDOW, (intptr_t)m_sbType,
- (intptr_t)&fPos);
- }
+ CPWL_Wnd* pParent = GetParentWindow();
+ if (!pParent || m_sbType != SBT_VSCROLL)
+ return;
+
+ pParent->ScrollWindowVertically(m_OriginInfo.fContentMax -
+ m_sData.fScrollPos);
}
CFX_FloatRect CPWL_ScrollBar::GetScrollArea() const {