| 1857 | } |
| 1858 | |
| 1859 | void OnMouseWheel(int wheel, WidgetID widget) override |
| 1860 | { |
| 1861 | if (widget != WID_SM_MAP) return; |
| 1862 | if (_settings_client.gui.scrollwheel_scrolling != SWS_OFF) { |
| 1863 | const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_SM_MAP); |
| 1864 | int cursor_x = _cursor.pos.x - this->left - wid->pos_x; |
| 1865 | int cursor_y = _cursor.pos.y - this->top - wid->pos_y; |
| 1866 | Point pt = {cursor_x, cursor_y}; |
| 1867 | this->SetZoomLevel((wheel < 0) ? ZLC_ZOOM_IN : ZLC_ZOOM_OUT, &pt); |
| 1868 | } |
| 1869 | } |
| 1870 | |
| 1871 | void OnScroll(Point delta) override |
| 1872 | { |
nothing calls this directly
no test coverage detected