summaryrefslogtreecommitdiff
path: root/src/linkgraph
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-05-19 14:49:25 +0000
committerrubidium <rubidium@openttd.org>2013-05-19 14:49:25 +0000
commitef7befdbd8b0d30e6ce121f4348799692b66d0ba (patch)
tree28be79f13ddeae1d11020509170c094fdf416746 /src/linkgraph
parent50ae992b47f581d8a50892942438bfe7e3f62141 (diff)
downloadopenttd-ef7befdbd8b0d30e6ce121f4348799692b66d0ba.tar.xz
(svn r25264) -Feature: linkgraph overlay over main viewport (fonsinchen)
Diffstat (limited to 'src/linkgraph')
-rw-r--r--src/linkgraph/linkgraph_gui.cpp10
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);
}
/**