MCPcopy Create free account
hub / github.com/DiscordMessenger/dm / Scroll

Method Scroll

src/windows/MessageList.cpp:4880–4901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4878}
4879
4880void MessageList::Scroll(int amount, RECT* rcClip, bool shiftAllRects)
4881{
4882 // amount - Amount of pixels to scroll UP
4883 if (shiftAllRects)
4884 {
4885 for (auto& msg : m_messages)
4886 msg.ShiftUp(amount);
4887 }
4888
4889 if (GetLocalSettings()->GetMessageStyle() == MS_IMAGE)
4890 {
4891 // nope, just invalidate
4892 InvalidateRect(m_hwnd, NULL, FALSE);
4893 return;
4894 }
4895
4896 // Note. In the case that any repainting is done, we perform the shifts
4897 // BEFORE repainting to avoid some weird glitches caused by a shift occuring
4898 // twice.
4899 ScrollWindowEx(m_hwnd, 0, -amount, rcClip, NULL, NULL, NULL, SW_INVALIDATE);
4900 UpdateWindow(m_hwnd);
4901}
4902
4903void MessageList::MessageHeightChanged(int oldHeight, int newHeight, bool toStart)
4904{

Callers 1

WndProcMethod · 0.80

Calls 3

GetLocalSettingsFunction · 0.85
ShiftUpMethod · 0.80
GetMessageStyleMethod · 0.80

Tested by

no test coverage detected