Skip to content

Commit

Permalink
Partial fix for ticket #444 (low resolution map composer maps). Hope
Browse files Browse the repository at this point in the history
I'm fixing it the right way :)


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6275 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Dec 18, 2006
1 parent 3f4af92 commit 3795371
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/composer/qgscomposermap.cpp
Expand Up @@ -117,11 +117,13 @@ void QgsComposerMap::draw ( QPainter *painter, QgsRect *extent, QgsMapToPixel *t
if ( layer->type() == QgsMapLayer::VECTOR ) {
QgsVectorLayer *vector = dynamic_cast <QgsVectorLayer*> (layer);

double widthScale = mWidthScale * mComposition->scale();
if ( plotStyle() == QgsComposition::Preview && mPreviewMode == Render ) {
widthScale *= mComposition->viewScale();
double widthScale = mWidthScale;
double symbolScale = mSymbolScale;
if (plotStyle() != QgsComposition::Preview)
{
widthScale /= mComposition->viewScale();
symbolScale /= mComposition->viewScale();
}
double symbolScale = mSymbolScale * mComposition->scale();

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

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

0 comments on commit 3795371

Please sign in to comment.