mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 08:38:45 +00:00
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:
committed by
Robert Carlsen
parent
07623bf94f
commit
1751d8bf12
@@ -156,12 +156,13 @@ GoogleMapControl::GoogleMapControl(MainWindow *mw)
|
||||
void
|
||||
GoogleMapControl::rideSelected()
|
||||
{
|
||||
if (parent->activeTab() != this)
|
||||
return;
|
||||
RideItem * ride = parent->rideItem();
|
||||
if (parent->activeTab() != this) return;
|
||||
|
||||
if (!ride)
|
||||
RideItem * ride = parent->rideItem();
|
||||
if (ride == current || !ride || !ride->ride())
|
||||
return;
|
||||
else
|
||||
current = ride;
|
||||
|
||||
int zone =ride->zoneRange();
|
||||
if(zone < 0)
|
||||
@@ -177,8 +178,6 @@ GoogleMapControl::rideSelected()
|
||||
double prevLon = 0;
|
||||
double prevLat = 0;
|
||||
|
||||
if (ride == NULL || ride->ride() == NULL) return;
|
||||
|
||||
foreach(RideFilePoint *rfp,ride->ride()->dataPoints())
|
||||
{
|
||||
RideFilePoint curRfp = *rfp;
|
||||
@@ -204,8 +203,15 @@ GoogleMapControl::rideSelected()
|
||||
|
||||
void GoogleMapControl::resizeEvent(QResizeEvent * )
|
||||
{
|
||||
newRideToLoad = true;
|
||||
loadRide();
|
||||
static bool first = true;
|
||||
if (parent->activeTab() != this) return;
|
||||
|
||||
if (first == true) {
|
||||
first = false;
|
||||
} else {
|
||||
newRideToLoad = true;
|
||||
loadRide();
|
||||
}
|
||||
}
|
||||
|
||||
void GoogleMapControl::loadStarted()
|
||||
|
||||
Reference in New Issue
Block a user