Author: Kore Nordmann Date: 2007-04-10 13:25:05 +0200 (Tue, 10 Apr 2007) New Revision: 4837
Log: - Removed debugging output #Shame on me! - Fixed testcases accordingly to latest additions Modified: trunk/Graph/src/renderer/axis_label_rotated.php trunk/Graph/tests/axis_rotated_renderer_test.php Modified: trunk/Graph/src/renderer/axis_label_rotated.php =================================================================== --- trunk/Graph/src/renderer/axis_label_rotated.php 2007-04-10 11:11:32 UTC (rev 4836) +++ trunk/Graph/src/renderer/axis_label_rotated.php 2007-04-10 11:25:05 UTC (rev 4837) @@ -164,12 +164,7 @@ ); $length = sqrt( pow( $width, 2 ) + pow( $height, 2 ) ); - - printf( "Angles: %.2f, %.2f (%d * %d)\n", - $this->angle = rad2deg( asin( $width / $length ) ), - $this->angle = rad2deg( acos( $height / $length ) ), - $width, $height - ); + $this->angle = rad2deg( acos( $height / $length ) ); } // Determine additional required axis space by boxes Modified: trunk/Graph/tests/axis_rotated_renderer_test.php =================================================================== --- trunk/Graph/tests/axis_rotated_renderer_test.php 2007-04-10 11:11:32 UTC (rev 4836) +++ trunk/Graph/tests/axis_rotated_renderer_test.php 2007-04-10 11:25:05 UTC (rev 4837) @@ -70,27 +70,27 @@ ->expects( $this->at( 0 ) ) ->method( 'drawText' ) ->with( - $this->equalTo( new ezcGraphBoundings( 132.5, 152., 160., 208. ), 1. ), - $this->equalTo( 'sample 1 ' ), - $this->equalTo( ezcGraph::MIDDLE | ezcGraph::RIGHT ), + $this->equalTo( new ezcGraphBoundings( 146.3, 180., 160., 236.6 ), 1. ), + $this->equalTo( 'sample 1' ), + $this->equalTo( ezcGraph::TOP | ezcGraph::RIGHT ), $this->equalTo( new ezcGraphRotation( -45, new ezcGraphCoordinate( 160, 180 ) ) ) ); $mockedRenderer ->expects( $this->at( 1 ) ) ->method( 'drawText' ) ->with( - $this->equalTo( new ezcGraphBoundings( 207.5, 152., 235., 208. ), 1. ), - $this->equalTo( 'sample 2 ' ), - $this->equalTo( ezcGraph::MIDDLE | ezcGraph::RIGHT ), + $this->equalTo( new ezcGraphBoundings( 221.3, 180., 235., 236.6 ), 1. ), + $this->equalTo( 'sample 2' ), + $this->equalTo( ezcGraph::TOP | ezcGraph::RIGHT ), $this->equalTo( new ezcGraphRotation( -45, new ezcGraphCoordinate( 235, 180 ) ) ) ); $mockedRenderer ->expects( $this->at( 4 ) ) ->method( 'drawText' ) ->with( - $this->equalTo( new ezcGraphBoundings( 432.5, 152., 460., 208. ), 1. ), - $this->equalTo( 'sample 5 ' ), - $this->equalTo( ezcGraph::MIDDLE | ezcGraph::RIGHT ), + $this->equalTo( new ezcGraphBoundings( 446.3, 180., 460., 236.6 ), 1. ), + $this->equalTo( 'sample 5' ), + $this->equalTo( ezcGraph::TOP | ezcGraph::RIGHT ), $this->equalTo( new ezcGraphRotation( -45, new ezcGraphCoordinate( 460, 180 ) ) ) ); @@ -116,27 +116,27 @@ ->expects( $this->at( 0 ) ) ->method( 'drawText' ) ->with( - $this->equalTo( new ezcGraphBoundings( 132.5, 152., 160., 208. ), 1. ), - $this->equalTo( 'sample 1 ' ), - $this->equalTo( ezcGraph::MIDDLE | ezcGraph::RIGHT ), + $this->equalTo( new ezcGraphBoundings( 146.3, 180., 160., 236.6 ), 1. ), + $this->equalTo( 'sample 1' ), + $this->equalTo( ezcGraph::TOP | ezcGraph::RIGHT ), $this->equalTo( new ezcGraphRotation( -45, new ezcGraphCoordinate( 160, 180 ) ) ) ); $mockedRenderer ->expects( $this->at( 1 ) ) ->method( 'drawText' ) ->with( - $this->equalTo( new ezcGraphBoundings( 207.5, 152., 235., 208. ), 1. ), - $this->equalTo( 'sample 2 ' ), - $this->equalTo( ezcGraph::MIDDLE | ezcGraph::RIGHT ), + $this->equalTo( new ezcGraphBoundings( 221.3, 180., 235., 236.6 ), 1. ), + $this->equalTo( 'sample 2' ), + $this->equalTo( ezcGraph::TOP | ezcGraph::RIGHT ), $this->equalTo( new ezcGraphRotation( -45, new ezcGraphCoordinate( 235, 180 ) ) ) ); $mockedRenderer ->expects( $this->at( 4 ) ) ->method( 'drawText' ) ->with( - $this->equalTo( new ezcGraphBoundings( 432.5, 152., 460., 208. ), 1. ), - $this->equalTo( 'sample 5 ' ), - $this->equalTo( ezcGraph::MIDDLE | ezcGraph::RIGHT ), + $this->equalTo( new ezcGraphBoundings( 446.3, 180., 460., 236.6 ), 1. ), + $this->equalTo( 'sample 5' ), + $this->equalTo( ezcGraph::TOP | ezcGraph::RIGHT ), $this->equalTo( new ezcGraphRotation( -45, new ezcGraphCoordinate( 460, 180 ) ) ) ); @@ -372,16 +372,16 @@ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); - $this->assertEqual( - $this->xAxis->axisLabelRenderer->angle, - 45., + $this->assertEquals( + $chart->xAxis->axisLabelRenderer->angle, + 76., 'Angle estimation wrong.', 1. ); - $this->assertEqual( - $this->yAxis->axisLabelRenderer->angle, - 45., + $this->assertEquals( + $chart->yAxis->axisLabelRenderer->angle, + 53., 'Angle estimation wrong.', 1. ); -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components