MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / OnMouseWheel

Method OnMouseWheel

src/main_gui.cpp:439–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437 }
438
439 void OnMouseWheel(int wheel, WidgetID widget) override
440 {
441 if (widget != WID_M_VIEWPORT) return;
442 if (_settings_client.gui.scrollwheel_scrolling != SWS_OFF) {
443 bool in = wheel < 0;
444
445 /* When following, only change zoom - otherwise zoom to the cursor. */
446 if (this->viewport->follow_vehicle != VehicleID::Invalid()) {
447 DoZoomInOutWindow(in ? ZOOM_IN : ZOOM_OUT, this);
448 } else {
449 ZoomInOrOutToCursorWindow(in, this);
450 }
451 }
452 }
453
454 void OnResize() override
455 {

Callers

nothing calls this directly

Calls 3

InvalidFunction · 0.85
DoZoomInOutWindowFunction · 0.85

Tested by

no test coverage detected