Skip to content

Commit 78b2341

Browse files
author
g_j_m
committed
Partial fix for ticket #444 (low resolution map composer maps). Hope
I'm fixing it the right way :) git-svn-id: http://svn.osgeo.org/qgis/trunk@6275 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 3388363 commit 78b2341

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/composer/qgscomposermap.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,13 @@ void QgsComposerMap::draw ( QPainter *painter, QgsRect *extent, QgsMapToPixel *t
117117
if ( layer->type() == QgsMapLayer::VECTOR ) {
118118
QgsVectorLayer *vector = dynamic_cast <QgsVectorLayer*> (layer);
119119

120-
double widthScale = mWidthScale * mComposition->scale();
121-
if ( plotStyle() == QgsComposition::Preview && mPreviewMode == Render ) {
122-
widthScale *= mComposition->viewScale();
120+
double widthScale = mWidthScale;
121+
double symbolScale = mSymbolScale;
122+
if (plotStyle() != QgsComposition::Preview)
123+
{
124+
widthScale /= mComposition->viewScale();
125+
symbolScale /= mComposition->viewScale();
123126
}
124-
double symbolScale = mSymbolScale * mComposition->scale();
125127

126128
QgsRect r1, r2;
127129
r1 = *extent;
@@ -205,7 +207,8 @@ void QgsComposerMap::cache ( void )
205207
// 1 pixel in cache should have ia similar size as 1 pixel in canvas
206208
// but it can result in big cache -> limit
207209

208-
int w = Q3CanvasRectangle::width() < 1000 ? Q3CanvasRectangle::width() : 1000;
210+
int w = Q3CanvasRectangle::width() * mComposition->viewScale();
211+
w = w < 1000 ? w : 1000;
209212
int h = (int) ( mExtent.height() * w / mExtent.width() );
210213
// It can happen that extent is not initialised well -> check
211214
if ( h < 1 || h > 10000 ) h = w;

0 commit comments

Comments
 (0)