* * rct2: 0x006E98F2 */
| 775 | * rct2: 0x006E98F2 |
| 776 | */ |
| 777 | static void InputScrollPartUpdateHThumb(WindowBase& w, WidgetIndex widgetIndex, int32_t x, int32_t scroll_id) |
| 778 | { |
| 779 | const auto& widget = w.widgets[widgetIndex]; |
| 780 | auto& scroll = w.scrolls[scroll_id]; |
| 781 | |
| 782 | auto* windowMgr = GetWindowManager(); |
| 783 | if (windowMgr->FindByNumber(w.classification, w.number) != nullptr) |
| 784 | { |
| 785 | int32_t newLeft; |
| 786 | newLeft = scroll.contentWidth; |
| 787 | newLeft *= x; |
| 788 | x = widget.width() - 22; |
| 789 | if (scroll.flags & VSCROLLBAR_VISIBLE) |
| 790 | x -= kScrollBarWidth + 1; |
| 791 | newLeft /= x; |
| 792 | x = newLeft; |
| 793 | scroll.flags |= HSCROLLBAR_THUMB_PRESSED; |
| 794 | newLeft = scroll.contentOffsetX; |
| 795 | newLeft += x; |
| 796 | if (newLeft < 0) |
| 797 | newLeft = 0; |
| 798 | x = widget.width() - 2; |
| 799 | if (scroll.flags & VSCROLLBAR_VISIBLE) |
| 800 | x -= kScrollBarWidth + 1; |
| 801 | x *= -1; |
| 802 | x += scroll.contentWidth; |
| 803 | if (x < 0) |
| 804 | x = 0; |
| 805 | if (newLeft > x) |
| 806 | newLeft = x; |
| 807 | scroll.contentOffsetX = newLeft; |
| 808 | widgetScrollUpdateThumbs(w, widgetIndex); |
| 809 | windowMgr->InvalidateWidgetByNumber(w.classification, w.number, widgetIndex); |
| 810 | } |
| 811 | } |
| 812 | |
| 813 | /** |
| 814 | * |
no test coverage detected