(svn r26338) -Fix [FS#5908]: Don't redraw the link graph overlay if it's empty (MJP)

This commit is contained in:
fonsinchen
2014-02-15 12:19:46 +00:00
parent 4a00552a09
commit 4055397915
2 changed files with 22 additions and 14 deletions

View File

@@ -253,11 +253,17 @@ struct MainWindow : Window
virtual void OnTick()
{
if (--refresh == 0) {
this->viewport->overlay->RebuildCache();
this->GetWidget<NWidgetBase>(WID_M_VIEWPORT)->SetDirty(this);
this->refresh = LINKGRAPH_REFRESH_PERIOD;
if (--this->refresh > 0) return;
this->refresh = LINKGRAPH_REFRESH_PERIOD;
if (this->viewport->overlay->GetCargoMask() == 0 ||
this->viewport->overlay->GetCompanyMask() == 0) {
return;
}
this->viewport->overlay->RebuildCache();
this->GetWidget<NWidgetBase>(WID_M_VIEWPORT)->SetDirty(this);
}
virtual void OnPaint()