summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-10-18 19:08:04 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-10-18 19:08:04 +0300
commit6c76da02a883c5956cd5f2cf87ac107b5c207f26 (patch)
treeb619c3934b9d1e5f24870718250a4123eb0e0ece
parent1d2f883b5ef5513aa57026b0556d56ed92da4e00 (diff)
minor fix for scrollbar tracking
-rw-r--r--plugins/NewStory/src/history_control.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index f0b73701d1..0b1c045ff1 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -370,7 +370,6 @@ void NewstoryListData::EnsureVisible(int item)
if (scrollTopItem >= item) {
scrollTopItem = item;
scrollTopPixel = 0;
- InvalidateRect(m_hwnd, 0, FALSE);
}
else {
RECT rc;
@@ -393,10 +392,10 @@ void NewstoryListData::EnsureVisible(int item)
if (!found) {
scrollTopItem = item;
scrollTopPixel = 0;
- InvalidateRect(m_hwnd, 0, FALSE);
}
}
FixScrollPosition();
+ InvalidateRect(m_hwnd, 0, FALSE);
}
int NewstoryListData::FindNext(const wchar_t *pwszText)
@@ -1170,9 +1169,9 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case SB_THUMBTRACK:
SCROLLINFO si;
si.cbSize = sizeof(si);
- si.fMask = SIF_TRACKPOS | SIF_RANGE;
+ si.fMask = SIF_ALL;
GetScrollInfo(hwnd, SB_VERT, &si);
- data->EnsureVisible(data->totalCount * si.nTrackPos / si.nMax);
+ data->EnsureVisible(si.nTrackPos);
break;
default: