diff options
author | PeterN <peter@fuzzle.org> | 2019-02-23 19:19:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-23 19:19:41 +0000 |
commit | 87ebfe1227ecc811a18d9b9c791e3e21da3f5eb2 (patch) | |
tree | 2792f87f0fbcc12ef020a7942ecd708011c54de0 /src/smallmap_gui.cpp | |
parent | f240f61fb2813a7cc3d2ad130477039b2a4701fd (diff) | |
download | openttd-87ebfe1227ecc811a18d9b9c791e3e21da3f5eb2.tar.xz |
Fix #7004: Mark linkgraph dirty to be rebuilt on next draw call. (#7265)
Previously the linkgraph was rebuilt before the viewport extents were finalized.
Diffstat (limited to 'src/smallmap_gui.cpp')
-rw-r--r-- | src/smallmap_gui.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index e4a091927..97d01325a 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -713,7 +713,7 @@ void SmallMapWindow::SetZoomLevel(ZoomLevelChange change, const Point *zoom_pt) this->SetNewScroll(this->scroll_x + (tile.x - new_tile.x) * TILE_SIZE, this->scroll_y + (tile.y - new_tile.y) * TILE_SIZE, sub); } else if (this->map_type == SMT_LINKSTATS) { - this->overlay->RebuildCache(); + this->overlay->SetDirty(); } this->SetWidgetDisabledState(WID_SM_ZOOM_IN, this->zoom == zoomlevels[MIN_ZOOM_INDEX]); this->SetWidgetDisabledState(WID_SM_ZOOM_OUT, this->zoom == zoomlevels[MAX_ZOOM_INDEX]); @@ -1290,7 +1290,7 @@ void SmallMapWindow::SwitchMapType(SmallMapType map_type) this->SetupWidgetData(); - if (map_type == SMT_LINKSTATS) this->overlay->RebuildCache(); + if (map_type == SMT_LINKSTATS) this->overlay->SetDirty(); if (map_type != SMT_INDUSTRY) this->BreakIndustryChainLink(); this->SetDirty(); } @@ -1573,7 +1573,7 @@ int SmallMapWindow::GetPositionOnLegend(Point pt) if (this->overlay->GetCompanyMask() != company_mask) { this->overlay->SetCompanyMask(company_mask); } else { - this->overlay->RebuildCache(); + this->overlay->SetDirty(); } } _smallmap_industry_highlight_state = !_smallmap_industry_highlight_state; @@ -1616,7 +1616,7 @@ void SmallMapWindow::SetNewScroll(int sx, int sy, int sub) this->scroll_x = sx; this->scroll_y = sy; this->subscroll = sub; - if (this->map_type == SMT_LINKSTATS) this->overlay->RebuildCache(); + if (this->map_type == SMT_LINKSTATS) this->overlay->SetDirty(); } /* virtual */ void SmallMapWindow::OnScroll(Point delta) |