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

Function InputScrollPartUpdateHRight

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

* * rct2: 0x006E9ABF */

Source from the content-addressed store, hash-verified

873 * rct2: 0x006E9ABF
874 */
875 static void InputScrollPartUpdateHRight(WindowBase& w, WidgetIndex widgetIndex, int32_t scroll_id)
876 {
877 const auto& widget = w.widgets[widgetIndex];
878
879 auto* windowMgr = GetWindowManager();
880 if (windowMgr->FindByNumber(w.classification, w.number) != nullptr)
881 {
882 auto& scroll = w.scrolls[scroll_id];
883 scroll.flags |= HSCROLLBAR_RIGHT_PRESSED;
884 scroll.contentOffsetX += 3;
885 int32_t newLeft = widget.width() - 2;
886 if (scroll.flags & VSCROLLBAR_VISIBLE)
887 newLeft -= kScrollBarWidth + 1;
888 newLeft *= -1;
889 newLeft += scroll.contentWidth;
890 if (newLeft < 0)
891 newLeft = 0;
892 if (scroll.contentOffsetX > newLeft)
893 scroll.contentOffsetX = newLeft;
894 widgetScrollUpdateThumbs(w, widgetIndex);
895 windowMgr->InvalidateWidgetByNumber(w.classification, w.number, widgetIndex);
896 }
897 }
898
899 /**
900 *

Callers 1

InputScrollContinueFunction · 0.85

Calls 5

GetWindowManagerFunction · 0.85
widgetScrollUpdateThumbsFunction · 0.85
widthMethod · 0.80
FindByNumberMethod · 0.45

Tested by

no test coverage detected