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

Function verticalNudgeDown

src/OpenLoco/src/Ui/ScrollView.cpp:399–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397 }
398
399 void verticalNudgeDown(Ui::Window& window, const size_t scrollAreaIndex, const WidgetIndex_t widgetIndex)
400 {
401 int16_t trackHeight = window.widgets[widgetIndex].height() - 2;
402 if (window.scrollAreas[scrollAreaIndex].hasFlags(ScrollFlags::hscrollbarVisible))
403 {
404 trackHeight -= kScrollbarSize;
405 }
406 int16_t widgetContentHeight = std::max(window.scrollAreas[scrollAreaIndex].contentHeight - trackHeight, 0);
407 window.scrollAreas[scrollAreaIndex].contentOffsetY = std::min<int16_t>(window.scrollAreas[scrollAreaIndex].contentOffsetY + kButtonClickStep, widgetContentHeight);
408 ScrollView::updateThumbs(window, widgetIndex);
409 WindowManager::invalidateWidget(window.type, window.number, widgetIndex);
410 }
411
412 // 0x004C8B85
413 static void vButtonBottom(Ui::Window& window, const size_t scrollAreaIndex, const WidgetIndex_t widgetIndex)

Callers 2

vButtonBottomFunction · 0.85
scrollDragFunction · 0.85

Calls 4

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

Tested by

no test coverage detected