mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-26 00:02:08 -05:00
add 1 pixel to rectangles only in preview
git-svn-id: http://svn.osgeo.org/qgis/trunk@3046 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
fe2b170ed0
commit
93f75d2289
@ -250,9 +250,14 @@ QRect QgsComposerScalebar::render ( QPainter *p )
|
||||
|
||||
int barLx = (int) ( cx - width/2 );
|
||||
|
||||
int rectadd = 0;
|
||||
if ( plotStyle() == QgsComposition::Preview ) {
|
||||
rectadd = 1; // add 1 pixel in preview, must not be in PS
|
||||
}
|
||||
|
||||
// fill odd
|
||||
for ( int i = 0; i < mNumSegments; i += 2 ) {
|
||||
painter->drawRect( barLx+i*segwidth, cy, segwidth+1, mHeight );
|
||||
painter->drawRect( barLx+i*segwidth, cy, segwidth+rectadd, mHeight );
|
||||
}
|
||||
|
||||
// ticks
|
||||
@ -263,7 +268,7 @@ QRect QgsComposerScalebar::render ( QPainter *p )
|
||||
|
||||
painter->setBrush( Qt::NoBrush );
|
||||
|
||||
painter->drawRect( barLx, cy, width+1, mHeight );
|
||||
painter->drawRect( barLx, cy, width+rectadd, mHeight );
|
||||
|
||||
// labels
|
||||
int h = metrics.height();
|
||||
|
Loading…
x
Reference in New Issue
Block a user