Skip to content

Commit

Permalink
Fixed #437 - 'one point' errors - in map composer and also in map canvas
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@6212 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Dec 8, 2006
1 parent 493e742 commit f81e8af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/composer/qgscomposermap.cpp
Expand Up @@ -294,7 +294,7 @@ void QgsComposerMap::draw ( QPainter & painter )
painter.setBrush( Qt::NoBrush );
painter.save();
painter.translate ( Q3CanvasRectangle::x(), Q3CanvasRectangle::y() );
painter.drawRect ( 0, 0, Q3CanvasRectangle::width()+1, Q3CanvasRectangle::height()+1 ); // is it right?
painter.drawRect ( 0, 0, Q3CanvasRectangle::width(), Q3CanvasRectangle::height() );
painter.restore();
}

Expand Down
8 changes: 3 additions & 5 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -699,13 +699,11 @@ void QgsMapCanvas::resizeEvent(QResizeEvent * e)

// Adjust the size (in pixels) of that we draw by the margins in
// the widget that the drawing eventually gets placed in. In my testing
// the margin was 2 pixels on each border. Add 1 more pixel just to
// be sure that the drawn map appears fully within the margins in
// the widget.
// the margin was 2 pixels on each border.
int top, bottom, right, left;
getContentsMargins(&left, &top, &right, &bottom);
width = width - (left + right + 1);
height = height - (top + bottom + 1);
width = width - (left + right);
height = height - (top + bottom);

mMap->resize(/*e->size()*/ QSize(width,height));

Expand Down

0 comments on commit f81e8af

Please sign in to comment.