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

Function hTrackLeft

src/OpenLoco/src/Ui/ScrollView.cpp:359–369  ·  view source on GitHub ↗

0x004C8A36

Source from the content-addressed store, hash-verified

357
358 // 0x004C8A36
359 static void hTrackLeft(Ui::Window& window, const size_t scrollAreaIndex, const WidgetIndex_t widgetIndex)
360 {
361 int16_t trackWidth = window.widgets[widgetIndex].width() - 2;
362 if (window.scrollAreas[scrollAreaIndex].hasFlags(ScrollFlags::vscrollbarVisible))
363 {
364 trackWidth -= kScrollbarSize;
365 }
366 window.scrollAreas[scrollAreaIndex].contentOffsetX = std::max(window.scrollAreas[scrollAreaIndex].contentOffsetX - trackWidth, 0);
367 ScrollView::updateThumbs(window, widgetIndex);
368 WindowManager::invalidateWidget(window.type, window.number, widgetIndex);
369 }
370
371 // 0x004C8AA6
372 static void hTrackRight(Ui::Window& window, const size_t scrollAreaIndex, const WidgetIndex_t widgetIndex)

Callers 1

scrollLeftBeginFunction · 0.85

Calls 4

updateThumbsFunction · 0.85
invalidateWidgetFunction · 0.85
widthMethod · 0.45
hasFlagsMethod · 0.45

Tested by

no test coverage detected