Skip to content

Commit d2c979f

Browse files
author
mhugent
committedJan 14, 2010
Prevent division by 0
git-svn-id: http://svn.osgeo.org/qgis/trunk@12764 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 03c6340 commit d2c979f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
 

‎src/core/symbology-ng/qgssymbollayerv2utils.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,15 @@ double QgsSymbolLayerV2Utils::pixelSizeScaleFactor( QgsRenderContext& c, QgsSymb
657657
}
658658
else //QgsSymbol::MapUnit
659659
{
660-
return c.rasterScaleFactor() / c.mapToPixel().mapUnitsPerPixel();
660+
double mup = c.mapToPixel().mapUnitsPerPixel();
661+
if ( mup > 0 )
662+
{
663+
return c.rasterScaleFactor() / c.mapToPixel().mapUnitsPerPixel();
664+
}
665+
else
666+
{
667+
return 1.0;
668+
}
661669
}
662670
}
663671

0 commit comments

Comments
 (0)
Please sign in to comment.