MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / vTrackBottom

Function vTrackBottom

src/OpenLoco/src/Ui/ScrollView.cpp:433–444  ·  view source on GitHub ↗

0x004C8C7D

Source from the content-addressed store, hash-verified

431
432 // 0x004C8C7D
433 static void vTrackBottom(Ui::Window& window, const size_t scrollAreaIndex, const WidgetIndex_t widgetIndex)
434 {
435 int16_t trackHeight = window.widgets[widgetIndex].height() - 2;
436 if (window.scrollAreas[scrollAreaIndex].hasFlags(ScrollFlags::hscrollbarVisible))
437 {
438 trackHeight -= kScrollbarSize;
439 }
440 int16_t widgetContentHeight = std::max(window.scrollAreas[scrollAreaIndex].contentHeight - trackHeight, 0);
441 window.scrollAreas[scrollAreaIndex].contentOffsetY = std::min<int16_t>(window.scrollAreas[scrollAreaIndex].contentOffsetY + trackHeight, widgetContentHeight);
442 ScrollView::updateThumbs(window, widgetIndex);
443 WindowManager::invalidateWidget(window.type, window.number, widgetIndex);
444 }
445
446 // 0x004C8689
447 void scrollLeftBegin(const int16_t x, const int16_t y, Ui::Window& window, Ui::Widget* const widget, const WidgetIndex_t widgetIndex)

Callers 1

scrollLeftBeginFunction · 0.85

Calls 4

updateThumbsFunction · 0.85
invalidateWidgetFunction · 0.85
heightMethod · 0.45
hasFlagsMethod · 0.45

Tested by

no test coverage detected