Changeset - r28070:25ff3d14bb8b
[Not reviewed]
master
0 3 0
Peter Nelson - 13 months ago 2023-10-31 01:29:16
peter1138@openttd.org
Codechange: Don't access SmallMapWindow method directly from LinkGraphOverlay.
3 files changed with 13 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/linkgraph/linkgraph_gui.cpp
Show inline comments
 
@@ -425,7 +425,7 @@ Point LinkGraphOverlay::GetStationMiddle
 
		return GetViewportStationMiddle(this->window->viewport, st);
 
	} else {
 
		/* assume this is a smallmap */
 
		return static_cast<const SmallMapWindow *>(this->window)->GetStationMiddle(st);
 
		return GetSmallMapStationMiddle(this->window, st);
 
	}
 
}
 

	
src/smallmap_gui.cpp
Show inline comments
 
@@ -1888,3 +1888,13 @@ bool ScrollMainWindowTo(int x, int y, in
 

	
 
	return res;
 
}
 

	
 
/**
 
 * Determine the middle of a station in the smallmap window.
 
 * @param st The station we're looking for.
 
 * @return Middle point of the station in the smallmap window.
 
 */
 
Point GetSmallMapStationMiddle(const Window *w, const Station *st)
 
{
 
	return static_cast<const SmallMapWindow *>(w)->GetStationMiddle(st);
 
}
src/smallmap_gui.h
Show inline comments
 
@@ -212,4 +212,6 @@ public:
 
	void OnMouseOver([[maybe_unused]] Point pt, int widget) override;
 
};
 

	
 
Point GetSmallMapStationMiddle(const Window *w, const Station *st);
 

	
 
#endif /* SMALLMAP_GUI_H */
0 comments (0 inline, 0 general)