Skip to content
Permalink
Browse files
Fix placement of simple markers in cached images
  • Loading branch information
mhugent committed Feb 26, 2013
1 parent 037f601 commit 7e793025c5c04b9b84fb35c8c0162654696348c8
Showing 1 changed file with 1 addition and 2 deletions.
@@ -183,8 +183,7 @@ void QgsSimpleMarkerSymbolLayerV2::prepareCache( QgsSymbolV2RenderContext& conte
// calculate necessary image size for the cache
double pw = (( mPen.widthF() == 0 ? 1 : mPen.widthF() ) + 1 ) / 2 * 2; // make even (round up); handle cosmetic pen
int imageSize = (( int ) scaledSize + pw ) / 2 * 2 + 1; // make image width, height odd; account for pen width

double center = (( double ) imageSize / 2 ) + 0.5; // add 1/2 pixel for proper rounding when the figure's coordinates are added
double center = imageSize / 2.0;

mCache = QImage( QSize( imageSize, imageSize ), QImage::Format_ARGB32_Premultiplied );
mCache.fill( 0 );

0 comments on commit 7e79302

Please sign in to comment.