Skip to content

Commit

Permalink
Revert "Don't resize canvas size on widget change"
Browse files Browse the repository at this point in the history
Revert this change for now as it has larger impacts
then I thought it would. Will improve and bring back
next release.

This reverts commit ef51b70.
  • Loading branch information
NathanW2 committed Jun 16, 2016
1 parent f9ff5e2 commit 5458d64
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions src/gui/qgsmapcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1480,11 +1480,13 @@ void QgsMapCanvas::mouseReleaseEvent( QMouseEvent* e )

} // mouseReleaseEvent

void QgsMapCanvas::updateMapSize()
void QgsMapCanvas::resizeEvent( QResizeEvent * e )
{
QGraphicsView::resizeEvent( e );
mResizeTimer->start( 500 );

QSize lastSize = viewport()->size();

mSettings.setOutputSize( lastSize );
mMapRenderer->setOutputSize( lastSize, mSettings.outputDpi() );

Expand All @@ -1502,28 +1504,12 @@ void QgsMapCanvas::updateMapSize()
emit extentsChanged();
}


void QgsMapCanvas::resizeEvent( QResizeEvent * e )
{
QGraphicsView::resizeEvent( e );

QSize size = viewport()->size();
if ( size.width() > mSettings.outputSize().width() || size.height() > mSettings.outputSize().height() )
{
updateMapSize();
}
else
{
moveCanvasContents( true );
}
}

void QgsMapCanvas::paintEvent( QPaintEvent *e )
{
// no custom event handling anymore

QGraphicsView::paintEvent( e );
}
} // paintEvent

void QgsMapCanvas::updateCanvasItemPositions()
{
Expand Down

1 comment on commit 5458d64

@nirvn
Copy link
Contributor

@nirvn nirvn commented on 5458d64 Jun 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sad to see this UX improvement reverted, but considering the regressions it's the sensible thing to do.

Please sign in to comment.