diff options
author | rubidium <rubidium@openttd.org> | 2013-05-19 14:49:25 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2013-05-19 14:49:25 +0000 |
commit | ef7befdbd8b0d30e6ce121f4348799692b66d0ba (patch) | |
tree | 28be79f13ddeae1d11020509170c094fdf416746 /src/linkgraph | |
parent | 50ae992b47f581d8a50892942438bfe7e3f62141 (diff) | |
download | openttd-ef7befdbd8b0d30e6ce121f4348799692b66d0ba.tar.xz |
(svn r25264) -Feature: linkgraph overlay over main viewport (fonsinchen)
Diffstat (limited to 'src/linkgraph')
-rw-r--r-- | src/linkgraph/linkgraph_gui.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/linkgraph/linkgraph_gui.cpp b/src/linkgraph/linkgraph_gui.cpp index 0d643bc68..736b5733e 100644 --- a/src/linkgraph/linkgraph_gui.cpp +++ b/src/linkgraph/linkgraph_gui.cpp @@ -11,6 +11,7 @@ #include "../stdafx.h" #include "../window_gui.h" +#include "../window_func.h" #include "../company_base.h" #include "../company_gui.h" #include "../date_func.h" @@ -268,7 +269,12 @@ void LinkGraphOverlay::DrawStationDots(const DrawPixelInfo *dpi) const */ Point LinkGraphOverlay::GetStationMiddle(const Station *st) const { - return static_cast<const SmallMapWindow *>(this->window)->GetStationMiddle(st); + if (this->window->viewport != NULL) { + return GetViewportStationMiddle(this->window->viewport, st); + } else { + /* assume this is a smallmap */ + return static_cast<const SmallMapWindow *>(this->window)->GetStationMiddle(st); + } } /** @@ -393,7 +399,7 @@ LinkGraphLegendWindow::LinkGraphLegendWindow(const WindowDesc *desc, int window_ { this->InitNested(desc, window_number); this->InvalidateData(0); - //this->SetOverlay(FindWindowById(WC_MAIN_WINDOW, 0)->viewport->overlay); + this->SetOverlay(FindWindowById(WC_MAIN_WINDOW, 0)->viewport->overlay); } /** |