Skip to content

Commit

Permalink
MainWindow: zoom to min/max when value is out of bound, show everithing
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgit committed Feb 6, 2022
1 parent d3f32ac commit 43a2371
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion viewer/mainwindow.cpp
Expand Up @@ -110,13 +110,32 @@ void MainWindow::loadSVG()
return;
}

//Show everithing
for(ssplib::ItemBase& label : stationPlan->labels)
{
label.visible = true;
}
for(ssplib::ItemBase& track : stationPlan->platforms)
{
track.visible = true;
}
for(ssplib::ItemBase& track : stationPlan->trackConnections)
{
track.visible = true;
}
stationPlan->drawLabels = true;
stationPlan->drawTracks = true;
stationPlan->platformPenWidth = 2;

setZoom(100);
zoomToFit();
}

void MainWindow::setZoom(int val)
{
if(val == zoom || val > 400 || val < 25)
val = qBound(25, val, 400);

if(val == zoom)
return;

zoom = val;
Expand Down

0 comments on commit 43a2371

Please sign in to comment.