Skip to content

Commit

Permalink
Fix zoom to visibile scale when min/max scale is set to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 8, 2017
1 parent 10707b8 commit f7bfb9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -9010,11 +9010,11 @@ void QgisApp::zoomToLayerScale()
if ( layer && layer->hasScaleBasedVisibility() )
{
const double scale = mMapCanvas->scale();
if ( scale > layer->minimumScale() )
if ( scale > layer->minimumScale() && layer->minimumScale() > 0 )
{
mMapCanvas->zoomScale( layer->minimumScale() * Qgis::SCALE_PRECISION );
}
else if ( scale <= layer->maximumScale() )
else if ( scale <= layer->maximumScale() && layer->maximumScale() > 0 )
{
mMapCanvas->zoomScale( layer->maximumScale() );
}
Expand Down

0 comments on commit f7bfb9c

Please sign in to comment.