[QGIS Commit] r11444 - trunk/qgis/src/core/symbology

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Aug 19 15:47:41 EDT 2009


Author: mhugent
Date: 2009-08-19 15:47:41 -0400 (Wed, 19 Aug 2009)
New Revision: 11444

Modified:
   trunk/qgis/src/core/symbology/qgssymbol.cpp
Log:
Use a tolerance to decide if a point symbol may be used from cached. Because on some systems, dpi in x- and y-direction are different and so the scaleProduct is not exactly 1

Modified: trunk/qgis/src/core/symbology/qgssymbol.cpp
===================================================================
--- trunk/qgis/src/core/symbology/qgssymbol.cpp	2009-08-19 19:09:10 UTC (rev 11443)
+++ trunk/qgis/src/core/symbology/qgssymbol.cpp	2009-08-19 19:47:41 UTC (rev 11444)
@@ -381,8 +381,10 @@
 QImage QgsSymbol::getPointSymbolAsImage( double widthScale, bool selected, QColor selectionColor, double scale,
     double rotation, double rasterScaleFactor, double opacity )
 {
+  double scaleProduct = scale * rasterScaleFactor;
 
-  if ( 1.0 == ( scale * rasterScaleFactor ) && 0 == rotation )
+  //on systems where dpi in x- and y-direction are not the same, the scaleProduct may differ from 1.0 by a very small number
+  if ( scaleProduct > 0.9 && scaleProduct < 1.1 && 0 == rotation )
   {
     if ( mWidthScale < 0 || widthScale == mWidthScale )
     {



More information about the QGIS-commit mailing list