summaryrefslogtreecommitdiff
path: root/src/linkgraph/linkgraph_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/linkgraph/linkgraph_gui.cpp')
-rw-r--r--src/linkgraph/linkgraph_gui.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/linkgraph/linkgraph_gui.cpp b/src/linkgraph/linkgraph_gui.cpp
index 7923fc26c..4db9f95b3 100644
--- a/src/linkgraph/linkgraph_gui.cpp
+++ b/src/linkgraph/linkgraph_gui.cpp
@@ -239,8 +239,12 @@ void LinkGraphOverlay::AddLinks(const Station *from, const Station *to)
* Draw the linkgraph overlay or some part of it, in the area given.
* @param dpi Area to be drawn to.
*/
-void LinkGraphOverlay::Draw(const DrawPixelInfo *dpi) const
+void LinkGraphOverlay::Draw(const DrawPixelInfo *dpi)
{
+ if (this->dirty) {
+ this->RebuildCache();
+ this->dirty = false;
+ }
this->DrawLinks(dpi);
this->DrawStationDots(dpi);
}