Skip to content

Commit

Permalink
Fix map canvas test
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Dec 9, 2016
1 parent cf5f373 commit 48f43b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/src/gui/testqgsmapcanvas.cpp
Expand Up @@ -316,25 +316,25 @@ void TestQgsMapCanvas::testZoomByWheel()
mCanvas->setWheelFactor( 2 );

//test zoom out
QWheelEvent e( QPoint( 0, 0 ), -1, Qt::NoButton, Qt::NoModifier );
QWheelEvent e( QPoint( 0, 0 ), -QWheelEvent::DefaultDeltasPerStep, Qt::NoButton, Qt::NoModifier );
mCanvas->wheelEvent( &e );
QGSCOMPARENEAR( mCanvas->extent().width(), originalWidth * 2.0, 0.1 );
QGSCOMPARENEAR( mCanvas->extent().height(), originalHeight * 2.0, 0.1 );

//test zoom in
e = QWheelEvent( QPoint( 0, 0 ), 1, Qt::NoButton, Qt::NoModifier );
e = QWheelEvent( QPoint( 0, 0 ), QWheelEvent::DefaultDeltasPerStep, Qt::NoButton, Qt::NoModifier );
mCanvas->wheelEvent( &e );
QGSCOMPARENEAR( mCanvas->extent().width(), originalWidth, 0.1 );
QGSCOMPARENEAR( mCanvas->extent().height(), originalHeight, 0.1 );

// test zoom out with ctrl
e = QWheelEvent( QPoint( 0, 0 ), -1, Qt::NoButton, Qt::ControlModifier );
e = QWheelEvent( QPoint( 0, 0 ), -QWheelEvent::DefaultDeltasPerStep, Qt::NoButton, Qt::ControlModifier );
mCanvas->wheelEvent( &e );
QGSCOMPARENEAR( mCanvas->extent().width(), 1.05 * originalWidth, 0.1 );
QGSCOMPARENEAR( mCanvas->extent().height(), 1.05 * originalHeight, 0.1 );

//test zoom in with ctrl
e = QWheelEvent( QPoint( 0, 0 ), 1, Qt::NoButton, Qt::ControlModifier );
e = QWheelEvent( QPoint( 0, 0 ), QWheelEvent::DefaultDeltasPerStep, Qt::NoButton, Qt::ControlModifier );
mCanvas->wheelEvent( &e );
QGSCOMPARENEAR( mCanvas->extent().width(), originalWidth, 0.1 );
QGSCOMPARENEAR( mCanvas->extent().height(), originalHeight, 0.1 );
Expand Down

0 comments on commit 48f43b0

Please sign in to comment.