Skip to content
Permalink
Browse files
Fix for marker size in map units
git-svn-id: http://svn.osgeo.org/qgis/trunk@13687 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jun 8, 2010
1 parent 98d578c commit 4d6c3108abc8d41fbef304b54889bf3ada3d4366
@@ -170,14 +170,7 @@ void QgsGraduatedSymbolRenderer::renderFeature( QgsRenderContext &renderContext,

if ( theSymbol->pointSizeUnits() )
{
/* Calc scale (still not nice) */
QgsPoint point;
point = renderContext.mapToPixel().transform( 0, 0 );
double x1 = point.x();
point = renderContext.mapToPixel().transform( 1000, 0 );
double x2 = point.x();

scale *= ( x2 - x1 ) * 0.001;
scale = 1.0 / renderContext.mapToPixel().mapUnitsPerPixel();
}

*img = theSymbol->getPointSymbolAsImage( scale, selected, mSelectionColor, fieldScale,
@@ -155,14 +155,7 @@ void QgsSingleSymbolRenderer::renderFeature( QgsRenderContext &renderContext, Qg

if ( sy->pointSizeUnits() )
{
/* Calc scale (still not nice) */
QgsPoint point;
point = renderContext.mapToPixel().transform( 0, 0 );
double x1 = point.x();
point = renderContext.mapToPixel().transform( 1000, 0 );
double x2 = point.x();

scale *= ( x2 - x1 ) * 0.001;
scale = 1.0 / renderContext.mapToPixel().mapUnitsPerPixel();
}

*img = sy->getPointSymbolAsImage( scale, selected, mSelectionColor, fieldScale, rotation, renderContext.rasterScaleFactor(), opacity );
@@ -145,14 +145,7 @@ void QgsUniqueValueRenderer::renderFeature( QgsRenderContext &renderContext, Qgs

if ( symbol->pointSizeUnits() )
{
/* Calc scale (still not nice) */
QgsPoint point;
point = renderContext.mapToPixel().transform( 0, 0 );
double x1 = point.x();
point = renderContext.mapToPixel().transform( 1000, 0 );
double x2 = point.x();

scale *= ( x2 - x1 ) * 0.001;
scale = 1.0 / renderContext.mapToPixel().mapUnitsPerPixel();
}

*img = symbol->getPointSymbolAsImage( scale, selected, mSelectionColor,

0 comments on commit 4d6c310

Please sign in to comment.