[Kstars-devel] branches/KDE/3.5/kdeedu/kstars/kstars

Pablo de Vicente pablo.devicente at gmail.com
Tue Nov 20 10:15:32 CET 2007


SVN commit 739030 by pvicente:

CCMAIL: kstars-devel at kde.org
BUG fixed. This bug was not explicitely declared in the KDE bug database.

Fixed the custom catalogs feature which was not working (all sources were
drawn at the same place). After this fix:
 - Stars are correctly drawn on the sky map.
 - The size of the spot for type 0 objects (stars) is proportional
   to the magnitude.
 - Names of the sources are shown
 - The sources are painted according to the color selected in the
   custom catalog dialog.

This fix has only been tested with stars (type 0 objects). No test tried
with other kind of objects.


 M  +8 -2      kstarsdata.cpp  
 M  +24 -0     skymapdraw.cpp  


--- branches/KDE/3.5/kdeedu/kstars/kstars/kstarsdata.cpp #739029:739030
@@ -1133,6 +1133,11 @@
 			ObjNames.append( o );
 			if ( o->hasLongName() && o->longname() != o->name() ) 
 				ObjNames.append( o, true ); //Add long name
+			// PdV
+			//if (reloadMode) {
+		        //        o->EquatorialToHorizontal( LST, geo()->lat() );
+			//}
+
 		}
 
 		return true;
@@ -2146,11 +2151,12 @@
 			}
 		}
 
+
 		//Custom Catalogs
 		for ( unsigned int j=0; j< CustomCatalogs.count(); ++j ) {
-			CustomCatalog *cat = CustomCatalogs.at(j);
+			QPtrList<SkyObject> cat = CustomCatalogs.at(j)->objList();
 			if ( Options::showCatalog()[j] ) {
-				for ( SkyObject *o = cat->objList().first(); o; o = cat->objList().next() ) {
+                                 for ( SkyObject *o = cat.first(); o; o = cat.next() ) {
 					if (needNewCoords) o->updateCoords( &num );
 					o->EquatorialToHorizontal( LST, geo->lat() );
 				}
--- branches/KDE/3.5/kdeedu/kstars/kstars/skymapdraw.cpp #739029:739030
@@ -1385,7 +1385,31 @@
 							if ( size > 0 ) {
 								QChar c = starobj->color();
 								QPixmap *spixmap = starpix->getPixmap( &c, size );
+
+								// Try to paint with the selected color
+								spixmap->fill(QColor( data->CustomCatalogs.at(i)->color() ));
 								starobj->draw( psky, sky, spixmap, o.x(), o.y(), true, scale );
+								// After drawing the star we display some extra info like
+								// the name ...
+								bool drawName = ( Options::showStarNames() && (starobj->name() != i18n("star") ) );
+								if ( !checkSlewing && (starobj->mag() <= Options::magLimitDrawStarInfo() )
+										&& ( drawName || Options::showStarMagnitudes() ) ) {
+
+											psky.setPen( QColor( data->colorScheme()->colorNamed( "SNameColor" ) ) );
+											QFont stdFont( psky.font() );
+											QFont smallFont( stdFont );
+											smallFont.setPointSize( stdFont.pointSize() - 2 );
+											if ( Options::zoomFactor() < 10.*MINZOOM ) {
+												psky.setFont( smallFont );
+											} else {
+												psky.setFont( stdFont );
+											}
+
+											starobj->drawLabel( psky, o.x(), o.y(), Options::zoomFactor(), drawName, Options::showStarMagnitudes(), scale );
+
+											//reset font
+											psky.setFont( stdFont );
+								}
 							}
 						} else {
 							DeepSkyObject *dso = (DeepSkyObject*)obj;


More information about the Kstars-devel mailing list