Remove update 'flicker' when tab selected

The recent patch to reduce redraws when rides are selected
causes each tab to redraw whenever the tab IS selected. This
patch reduces this by remembering the current ride plotted.

It also fixes the "double draw" in GoogleMapControl and AllPlot
when selected for the first time.
This commit is contained in:
Mark Liversedge
2010-04-04 21:38:54 +01:00
committed by Robert Carlsen
parent 07623bf94f
commit 1751d8bf12
8 changed files with 40 additions and 11 deletions

View File

@@ -239,15 +239,22 @@ AllPlotWindow::rideSelected()
if (mainWindow->activeTab() != this)
return;
RideItem *ride = mainWindow->rideItem();
if (!ride)
if (!ride || ride == current)
return;
current = ride;
int showit = showStack->isChecked();
if (showit) allPlot->hide();
else allPlot->show();
// set it up anyway since the stack plots
// reuse the arrays
clearSelection(); // clear any ride interval selection data
setAllPlotWidgets(ride);
allPlot->setDataI(ride);
allZoomer->setZoomBase();
// update stacked view if that is set
int showit = showStack->isChecked();
setShowStack(0); // zap whats there
setShowStack(showit);
}