diff options
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 7 | ||||
-rw-r--r-- | plugins/NewStory/src/stdafx.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index 0b1c045ff1..365ad3e8aa 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -375,9 +375,9 @@ void NewstoryListData::EnsureVisible(int item) RECT rc; GetClientRect(m_hwnd, &rc); int height = rc.bottom - rc.top; - int top = scrollTopPixel; int idx = scrollTopItem; int itemHeight = GetItemHeight(idx); + int top = itemHeight + scrollTopPixel; bool found = false; while (top < height) { if (idx == item) { @@ -1171,7 +1171,10 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM si.cbSize = sizeof(si); si.fMask = SIF_ALL; GetScrollInfo(hwnd, SB_VERT, &si); - data->EnsureVisible(si.nTrackPos); + + data->scrollTopItem = si.nTrackPos; + data->scrollTopPixel = 0; + data->FixScrollPosition(); break; default: diff --git a/plugins/NewStory/src/stdafx.h b/plugins/NewStory/src/stdafx.h index c22b02d497..70039c4c3f 100644 --- a/plugins/NewStory/src/stdafx.h +++ b/plugins/NewStory/src/stdafx.h @@ -40,11 +40,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <m_fontservice.h> #include <m_history.h> #include <m_hotkeys.h> +#include <m_icolib.h> #include <m_json.h> #include <m_langpack.h> #include <m_message.h> #include <m_metacontacts.h> -#include <m_icolib.h> #include <m_options.h> #include <m_protocols.h> #include <m_protosvc.h> |