From 082733abdaef7f16ca058f3baa4882a7635a1542 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Wed, 6 Dec 2017 08:21:30 +1000 Subject: [PATCH] Fix unit test --- tests/src/core/testqgslayout.cpp | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/tests/src/core/testqgslayout.cpp b/tests/src/core/testqgslayout.cpp index b652bc1aa58..8379a696787 100644 --- a/tests/src/core/testqgslayout.cpp +++ b/tests/src/core/testqgslayout.cpp @@ -277,28 +277,28 @@ void TestQgsLayout::bounds() QgsLayoutItemShape *shape1 = new QgsLayoutItemShape( &l ); shape1->attemptResize( QgsLayoutSize( 90, 50 ) ); shape1->attemptMove( QgsLayoutPoint( 90, 50 ) ); - shape1->setItemRotation( 45 ); + shape1->setItemRotation( 45, false ); l.addLayoutItem( shape1 ); QgsLayoutItemShape *shape2 = new QgsLayoutItemShape( &l ); shape2->attemptResize( QgsLayoutSize( 110, 50 ) ); shape2->attemptMove( QgsLayoutPoint( 100, 150 ), true, false, 0 ); l.addLayoutItem( shape2 ); QgsLayoutItemShape *shape3 = new QgsLayoutItemShape( &l ); -// l.addLayoutItem( shape3 ); + l.addLayoutItem( shape3 ); shape3->attemptResize( QgsLayoutSize( 50, 100 ) ); shape3->attemptMove( QgsLayoutPoint( 210, 30 ), true, false, 1 ); QgsLayoutItemShape *shape4 = new QgsLayoutItemShape( &l ); -// l.addLayoutItem( shape4 ); + l.addLayoutItem( shape4 ); shape4->attemptResize( QgsLayoutSize( 50, 30 ) ); shape4->attemptMove( QgsLayoutPoint( 10, 120 ), true, false, 1 ); shape4->setVisibility( false ); //check bounds QRectF layoutBounds = l.layoutBounds( false ); -// QGSCOMPARENEAR( layoutBounds.height(), 430, 0.01 ); -// QGSCOMPARENEAR( layoutBounds.width(), 297.00, 0.01 ); -// QGSCOMPARENEAR( layoutBounds.left(), 0.0, 0.01 ); -// QGSCOMPARENEAR( layoutBounds.top(), 0.0, 0.01 ); + QGSCOMPARENEAR( layoutBounds.height(), 430, 0.01 ); + QGSCOMPARENEAR( layoutBounds.width(), 297.00, 0.01 ); + QGSCOMPARENEAR( layoutBounds.left(), 0.0, 0.01 ); + QGSCOMPARENEAR( layoutBounds.top(), 0.0, 0.01 ); QRectF layoutBoundsNoPage = l.layoutBounds( true ); QGSCOMPARENEAR( layoutBoundsNoPage.height(), 320.36, 0.01 ); @@ -306,17 +306,6 @@ void TestQgsLayout::bounds() QGSCOMPARENEAR( layoutBoundsNoPage.left(), 9.85, 0.01 ); QGSCOMPARENEAR( layoutBoundsNoPage.top(), 49.79, 0.01 ); - QGSCOMPARENEAR( layoutBounds.height(), 210.000000, 0.01 ); - QGSCOMPARENEAR( layoutBounds.width(), 297.000000, 0.01 ); - QGSCOMPARENEAR( layoutBounds.left(), 0.00000, 0.01 ); - QGSCOMPARENEAR( layoutBounds.top(), 0.00000, 0.01 ); - - layoutBoundsNoPage = l.layoutBounds( true ); - QGSCOMPARENEAR( layoutBoundsNoPage.height(), 174.859607, 0.01 ); - QGSCOMPARENEAR( layoutBoundsNoPage.width(), 124.859607, 0.01 ); - QGSCOMPARENEAR( layoutBoundsNoPage.left(), 85.290393, 0.01 ); - QGSCOMPARENEAR( layoutBoundsNoPage.top(), 25.290393, 0.01 ); - #if 0 QRectF page1Bounds = composition->pageItemBounds( 0, true ); QGSCOMPARENEAR( page1Bounds.height(), 150.36, 0.01 );