Skip to content

Commit

Permalink
Fix placement of simple markers in cached images
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Feb 26, 2013
1 parent 037f601 commit 7e79302
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 7e79302

Please sign in to comment.