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

Function vTrackTop

src/OpenLoco/src/Ui/ScrollView.cpp:420–430  ·  view source on GitHub ↗

0x004C8C0D

Source from the content-addressed store, hash-verified

418
419 // 0x004C8C0D
420 static void vTrackTop(Ui::Window& window, const size_t scrollAreaIndex, const WidgetIndex_t widgetIndex)
421 {
422 int16_t trackHeight = window.widgets[widgetIndex].height() - 2;
423 if (window.scrollAreas[scrollAreaIndex].hasFlags(ScrollFlags::hscrollbarVisible))
424 {
425 trackHeight -= kScrollbarSize;
426 }
427 window.scrollAreas[scrollAreaIndex].contentOffsetY = std::max(window.scrollAreas[scrollAreaIndex].contentOffsetY - trackHeight, 0);
428 ScrollView::updateThumbs(window, widgetIndex);
429 WindowManager::invalidateWidget(window.type, window.number, widgetIndex);
430 }
431
432 // 0x004C8C7D
433 static void vTrackBottom(Ui::Window& window, const size_t scrollAreaIndex, 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