Skip to content
Permalink
Browse files

atan2, sqrt fix

git-svn-id: http://svn.osgeo.org/qgis/trunk@5011 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek
rblazek committed Mar 13, 2006
1 parent a1221aa commit 073873d7d7d5621036183860595a5a8a276d7695
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/composer/qgscomposerpicture.cpp
@@ -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 ) );

0 comments on commit 073873d

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