Skip to content

Commit

Permalink
Fix for marker size in map units
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13687 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jun 8, 2010
1 parent dd8f249 commit 2b4c349
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
9 changes: 1 addition & 8 deletions src/core/renderer/qgsgraduatedsymbolrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 1 addition & 8 deletions src/core/renderer/qgssinglesymbolrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
9 changes: 1 addition & 8 deletions src/core/renderer/qgsuniquevaluerenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2b4c349

Please sign in to comment.