MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / InputScrollPartUpdateVBottom

Function InputScrollPartUpdateVBottom

src/openrct2-ui/input/MouseInput.cpp:921–943  ·  view source on GitHub ↗

* * rct2: 0x006E9C96 */

Source from the content-addressed store, hash-verified

919 * rct2: 0x006E9C96
920 */
921 static void InputScrollPartUpdateVBottom(WindowBase& w, WidgetIndex widgetIndex, int32_t scroll_id)
922 {
923 const auto& widget = w.widgets[widgetIndex];
924
925 auto* windowMgr = GetWindowManager();
926 if (windowMgr->FindByNumber(w.classification, w.number) != nullptr)
927 {
928 auto& scroll = w.scrolls[scroll_id];
929 scroll.flags |= VSCROLLBAR_DOWN_PRESSED;
930 scroll.contentOffsetY += 3;
931 int32_t newTop = widget.height() - 2;
932 if (scroll.flags & HSCROLLBAR_VISIBLE)
933 newTop -= kScrollBarWidth + 1;
934 newTop *= -1;
935 newTop += scroll.contentHeight;
936 if (newTop < 0)
937 newTop = 0;
938 if (scroll.contentOffsetY > newTop)
939 scroll.contentOffsetY = newTop;
940 widgetScrollUpdateThumbs(w, widgetIndex);
941 windowMgr->InvalidateWidgetByNumber(w.classification, w.number, widgetIndex);
942 }
943 }
944
945#pragma endregion
946

Callers 1

InputScrollContinueFunction · 0.85

Calls 5

GetWindowManagerFunction · 0.85
widgetScrollUpdateThumbsFunction · 0.85
heightMethod · 0.80
FindByNumberMethod · 0.45

Tested by

no test coverage detected