Scrolling/perf improvements to link graph overlays on viewport and smallmap

This commit is contained in:
Jonathan G Rennison
2018-05-26 09:07:37 +01:00
parent fe1e0a9d59
commit 0d0d55f81d
7 changed files with 104 additions and 37 deletions

View File

@@ -617,8 +617,6 @@ void SmallMapWindow::SetZoomLevel(ZoomLevelChange change, const Point *zoom_pt)
Point new_tile = this->PixelToTile(zoom_pt->x, zoom_pt->y, &sub);
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->SetWidgetDisabledState(WID_SM_ZOOM_IN, this->zoom == zoomlevels[MIN_ZOOM_INDEX]);
this->SetWidgetDisabledState(WID_SM_ZOOM_OUT, this->zoom == zoomlevels[MAX_ZOOM_INDEX]);
@@ -1538,7 +1536,6 @@ 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();
}
/* virtual */ void SmallMapWindow::OnScroll(Point delta)