[Kstars-devel] KDE/kdeedu/kstars/kstars/skycomponents

Jason Harris kstars at 30doradus.org
Sat Dec 2 15:56:46 CET 2006


SVN commit 609921 by harris:

New feature: the constellation boundary that encoses the 
current focus point is now highlighted.  

TODO: make this optional, and ad option to highlight the 
constellation enclosing the mous position instead (which 
will be a bit more difficult, because it should be done in
the overlay layer).

CCMAIL: kstars-devel at kde.org



 M  +19 -0     constellationboundarycomponent.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/constellationboundarycomponent.cpp #609920:609921
@@ -121,6 +121,13 @@
 	float Width = scale * map->width();
 	float Height = scale * map->height();
 
+	QString abbrev = QString(); 
+	QString cname = ks->data()->skyComposite()->constellation( map->focus() ).toLower();
+	foreach ( SkyObject *o, ks->data()->skyComposite()->constellationNames() ) {
+		if ( o->name().toLower() == cname ) 
+			abbrev = o->name2().toLower();
+	}
+
 	psky.setPen( QPen( QColor( ks->data()->colorScheme()->colorNamed( "CBoundColor" ) ), 1, Qt::SolidLine ) );
 	psky.setBrush( Qt::NoBrush );
 
@@ -133,6 +140,13 @@
 			started = true;
 		}
 
+		//Highlight current constellation
+		bool highlightConstellation = false;
+		if ( seg->name1().toLower() == abbrev || seg->name2().toLower() == abbrev ) {
+			psky.setPen( QPen( QColor( ks->data()->colorScheme()->colorNamed( "CBoundColor" ) ), 3, Qt::SolidLine ) );
+			highlightConstellation = true;
+		}
+
 		foreach ( SkyPoint *p, seg->nodes() ) {
 			QPointF o = map->toScreen( p, scale );
 
@@ -152,6 +166,11 @@
 				started = false;
 			}
 		}
+
+		if ( highlightConstellation ) {
+			psky.setPen( QPen( QColor( ks->data()->colorScheme()->colorNamed( "CBoundColor" ) ), 1, Qt::SolidLine ) );
+		}
+
 	}
 }
 


More information about the Kstars-devel mailing list