Skip to content
Permalink
Browse files

Revert "Don't resize canvas size on widget change"

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 5458d6445fe4427993a12466ec4a433ef3a2e422
Showing with 4 additions and 18 deletions.
  1. +4 −18 src/gui/qgsmapcanvas.cpp
@@ -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() );

@@ -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()
{

1 comment on commit 5458d64

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn commented on 5458d64 Jun 16, 2016

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

Please sign in to comment.
You can’t perform that action at this time.