diff --git a/src/linkgraph/linkgraph_gui.cpp b/src/linkgraph/linkgraph_gui.cpp index e284a156be..18337ffa18 100644 --- a/src/linkgraph/linkgraph_gui.cpp +++ b/src/linkgraph/linkgraph_gui.cpp @@ -425,7 +425,7 @@ Point LinkGraphOverlay::GetStationMiddle(const Station *st) const return GetViewportStationMiddle(this->window->viewport, st); } else { /* assume this is a smallmap */ - return static_cast(this->window)->GetStationMiddle(st); + return GetSmallMapStationMiddle(this->window, st); } } diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 09f73b6d32..91f0ead98b 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1888,3 +1888,13 @@ bool ScrollMainWindowTo(int x, int y, int z, bool instant) 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(w)->GetStationMiddle(st); +} diff --git a/src/smallmap_gui.h b/src/smallmap_gui.h index 570a256f98..e051f788a8 100644 --- a/src/smallmap_gui.h +++ b/src/smallmap_gui.h @@ -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 */