[Kstars-devel] kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Mon Jul 19 19:21:43 CEST 2004


CVS commit by harris: 

Fixing bug #83849 (Planet symbols not correct size)

We do some rescaling of planet images because the image size changes as the image is rotated.  However, we shouldn't apply this rescaling if planets are shown as circles instead of images.

CCMAIL: 83849-done at bugs.kde.org
CCMAIL: kstars-devel at kde.org


  M +26 -22    skymapdraw.cpp   1.69


--- kdeedu/kstars/kstars/skymapdraw.cpp  #1.68:1.69
@@ -1642,5 +1642,15 @@ void SkyMap::drawPlanet( QPainter &psky,
                 QPoint o = getXY( p, Options::useAltAz(), Options::useRefraction(), scale );
         
+                //Is planet onscreen?
                 if ( o.x() >= 0 && o.x() <= Width && o.y() >= 0 && o.y() <= Height ) {
+                        int size = int( p->angSize() * scale * dms::PI * Options::zoomFactor()/10800.0 );
+                        if ( size < sizemin ) size = sizemin;
+                        
+                        //Draw planet image if:
+                        if ( Options::showPlanetImages() &&  //user wants them,
+                                        int(Options::zoomFactor()) >= int(zoommin) &&  //zoomed in enough,
+                                        !p->image()->isNull() &&  //image loaded ok,
+                                        size < Width ) {  //and size isn't too big.
+                                
                         //Image size must be modified to account for possibility that rotated image's
                         //size is bigger than original image size.  The rotated image is a square
@@ -1653,17 +1663,11 @@ void SkyMap::drawPlanet( QPainter &psky,
                         double spa, cpa;
                         pa.SinCos( spa, cpa );
-                        cpa = fabs(cpa); spa = fabs(spa);
+                                cpa = fabs(cpa); 
+                                spa = fabs(spa);
+                                size = int( size * (cpa + spa) );
                         
-                        int size = int( p->angSize() * scale * dms::PI * Options::zoomFactor()/10800.0 * (cpa + spa) );
-                        //Because Saturn has rings, we inflate its size by a factor 2.5 
+                                //Because Saturn has rings, we inflate its image size by a factor 2.5 
                         if ( p->name() == "Saturn" ) size = int(2.5*size);
                         
-                        if ( size < sizemin ) size = sizemin;
-                                                                                                                                                                                                //Only draw planet image if:
-                        if ( Options::showPlanetImages() &&     //user wants them,
-                                        int(Options::zoomFactor()) >= int(zoommin) &&   //zoomed in enough,
-                                        !p->image()->isNull() &&               //image loaded ok,
-                                        size < Width ) {                       //and size isn't too big.
-        
                                 if (resize_mult != 1) {
                                         size *= resize_mult;




More information about the Kstars-devel mailing list