[Kstars-devel] KDE/kdeedu/kstars/kstars
Jason Harris
kstars at 30doradus.org
Mon Jun 6 01:57:35 CEST 2005
SVN commit 422632 by harris:
Improvements to star name labels:
+ font size smaller at low zoom
+ don't draw "star" for unnamed stars (thanks Milton)
CCMAIL: kstars-devel at kde.org
M +16 -2 skymapdraw.cpp
--- trunk/KDE/kdeedu/kstars/kstars/skymapdraw.cpp #422631:422632
@@ -1217,12 +1217,26 @@
curStar->draw( psky, sky, spixmap, o.x(), o.y(), true, scale );
// now that we have drawn the star, we can display some extra info
+ //don't label unnamed stars with the generic "star" name
+ bool drawName = ( Options::showStarNames() && (curStar->name() != i18n("star") ) );
if ( !checkSlewing && (curStar->mag() <= Options::magLimitDrawStarInfo() )
- && ( Options::showStarNames() || Options::showStarMagnitudes() ) ) {
+ && ( 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 );
+ }
+
curStar->drawLabel( psky, o.x(), o.y(), Options::zoomFactor(),
- Options::showStarNames(), Options::showStarMagnitudes(), scale );
+ drawName, Options::showStarMagnitudes(), scale );
+
+ //reset font
+ psky.setFont( stdFont );
}
}
}
More information about the Kstars-devel
mailing list