Skip to content
Permalink
Browse files

Remove deprecated wheel action behaviour from composer

  • Loading branch information
nyalldawson committed May 29, 2016
1 parent d6ec868 commit f9a10e4a995dd96af0ff59b9a7141243b386dd47
Showing with 5 additions and 27 deletions.
  1. +5 −27 src/gui/qgscomposerview.cpp
@@ -2032,14 +2032,8 @@ void QgsComposerView::wheelZoom( QWheelEvent * event )
{
//get mouse wheel zoom behaviour settings
QSettings mySettings;
int wheelAction = mySettings.value( "/qgis/wheel_action", 2 ).toInt();
double zoomFactor = mySettings.value( "/qgis/zoom_factor", 2 ).toDouble();

if (( QgsMapCanvas::WheelAction )wheelAction == QgsMapCanvas::WheelNothing )
{
return;
}

if ( event->modifiers() & Qt::ControlModifier )
{
//holding ctrl while wheel zooming results in a finer zoom
@@ -2057,27 +2051,11 @@ void QgsComposerView::wheelZoom( QWheelEvent * event )
//transform the mouse pos to scene coordinates
QPointF scenePoint = mapToScene( event->pos() );

//adjust view center according to wheel action setting
switch (( QgsMapCanvas::WheelAction )wheelAction )
{
case QgsMapCanvas::WheelZoomAndRecenter:
{
centerOn( scenePoint.x(), scenePoint.y() );
break;
}

case QgsMapCanvas::WheelZoomToMouseCursor:
{
QgsPoint oldCenter( visibleRect.center() );
QgsPoint newCenter( scenePoint.x() + (( oldCenter.x() - scenePoint.x() ) * scaleFactor ),
scenePoint.y() + (( oldCenter.y() - scenePoint.y() ) * scaleFactor ) );
centerOn( newCenter.x(), newCenter.y() );
break;
}

default:
break;
}
//adjust view center
QgsPoint oldCenter( visibleRect.center() );
QgsPoint newCenter( scenePoint.x() + (( oldCenter.x() - scenePoint.x() ) * scaleFactor ),
scenePoint.y() + (( oldCenter.y() - scenePoint.y() ) * scaleFactor ) );
centerOn( newCenter.x(), newCenter.y() );

//zoom composition
if ( zoomIn )

0 comments on commit f9a10e4

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