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

Function ZoomInOrOutToCursorWindow

src/main_gui.cpp:142–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142void ZoomInOrOutToCursorWindow(bool in, Window *w)
143{
144 assert(w != nullptr);
145
146 if (_game_mode != GM_MENU) {
147 if ((in && w->viewport->zoom <= _settings_client.gui.zoom_min) || (!in && w->viewport->zoom >= _settings_client.gui.zoom_max)) return;
148
149 Point pt = GetTileZoomCenterWindow(in, w);
150 if (pt.x != -1) {
151 ScrollWindowTo(pt.x, pt.y, -1, w, true);
152
153 DoZoomInOutWindow(in ? ZOOM_IN : ZOOM_OUT, w);
154 }
155 }
156}
157
158void FixTitleGameZoom(int zoom_adjust)
159{

Callers 2

OnMouseWheelMethod · 0.85
OnMouseWheelMethod · 0.85

Calls 3

GetTileZoomCenterWindowFunction · 0.85
ScrollWindowToFunction · 0.85
DoZoomInOutWindowFunction · 0.85

Tested by

no test coverage detected