Fixed #437 - 'one point' errors - in map composer and also in map canvas

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6212 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
wonder 2006-12-08 15:33:57 +00:00
parent 09bfc8aa0f
commit 599456e749
2 changed files with 4 additions and 6 deletions

View File

@ -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();
}

View File

@ -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));