Skip to content
Permalink
Browse files

Fix map canvas test

  • Loading branch information
m-kuhn committed Dec 9, 2016
1 parent cf5f373 commit 48f43b0862c35edaed220c9f87e8dd10deb7c7d7
Showing with 4 additions and 4 deletions.
  1. +4 −4 tests/src/gui/testqgsmapcanvas.cpp
@@ -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 );

0 comments on commit 48f43b0

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