Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
atan2, sqrt fix
git-svn-id: http://svn.osgeo.org/qgis/trunk@5011 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Mar 13, 2006
1 parent a1221aa commit 073873d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/composer/qgscomposerpicture.cpp
Expand Up @@ -293,14 +293,14 @@ void QgsComposerPicture::recalculate()

// Angle between vertical in picture space and the vector
// from center to upper left corner of the picture
double anglePicture = atan2 ( box.width(), box.height() );
double anglePicture = atan2 ( (double)box.width(), (double)box.height() );

// Angle (clockwise) between horizontal in paper space
// and the vector from center to upper left corner of the picture
double anglePaper = PI / 2 - anglePicture - angle;

// Distance from center to upper left corner in canvas units
double r = sqrt ( mWidth*mWidth/4 + mHeight*mHeight/4 );
double r = sqrt ((double)(mWidth*mWidth/4 + mHeight*mHeight/4) );

// Position of upper left corner in map
int dx = (int) ( r * cos ( anglePaper ) );
Expand Down

0 comments on commit 073873d

Please sign in to comment.