[Kstars-devel] kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Mon Aug 16 03:08:03 CEST 2004


CVS commit by harris: 

Fix horrible blocky star images in printed sky maps
(TO BE BACKPORTED)

CCMAIL: kstars-devel at kde.org


  M +114 -124  skymapdraw.cpp   1.72


--- kdeedu/kstars/kstars/skymapdraw.cpp  #1.71:1.72
@@ -1095,11 +1095,4 @@ void SkyMap::drawStars( QPainter& psky, 
                 float sizeFactor = 6.0 + (lgz - lgmin);
 
-//              //Need a pen color for the multiple star and variable star indicators
-//              switch( data->colorScheme()->starColorMode() ) {
-//                      case 1 : psky.setPen( Qt::red ); break;
-//                      case 2 : psky.setPen( Qt::black ); break;
-//                      default: psky.setPen( Qt::white ); break;
-//              }
-
                 for ( StarObject *curStar = data->starList.first(); curStar; curStar = data->starList.next() ) {
                         // break loop if maglim is reached
@@ -1111,13 +1104,10 @@ void SkyMap::drawStars( QPainter& psky, 
                                 // draw star if currently on screen
                                 if (o.x() >= 0 && o.x() <= Width && o.y() >=0 && o.y() <= Height ) {
-                                        int size = int( sizeFactor*( maglim - curStar->mag())/maglim ) + 1;
+                                        int size = int( scale * ( sizeFactor*( maglim - curStar->mag())/maglim ) + 1 );
 
                                         if ( size > 0 ) {
                                                 QChar c = curStar->color();
-                                                QImage tmp = starpix->getPixmap( &c, size )->convertToImage();
-                                                if ( scale != 1.0 ) tmp = tmp.smoothScale( int(scale*tmp.width()), int(scale*tmp.height()) );
-                                                QPixmap spixmap( tmp );
-                                                //QPixmap *spixmap = starpix->getPixmap( &c, size );
-                                                curStar->draw( psky, sky, &spixmap, o.x(), o.y(), true, scale );
+                                                QPixmap *spixmap = starpix->getPixmap( &c, size );
+                                                curStar->draw( psky, sky, spixmap, o.x(), o.y(), true, scale );
                                                 
                                                 // now that we have drawn the star, we can display some extra info




More information about the Kstars-devel mailing list