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

Jason Harris kstars at 30doradus.org
Wed Jan 30 01:55:52 CET 2008


SVN commit 768419 by harris:

Patch from Akarsh to make placement of name labels for elongated
objects slightly closer to the object's center.  Will backport to 4.0.

Thanks Akarsh!

CCMAIL: kstars-devel at kde.org



 M  +6 -2      deepskyobject.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/deepskyobject.cpp #768418:768419
@@ -328,8 +328,12 @@
 double DeepSkyObject::labelOffset() const {
     //Calculate object size in pixels
     double majorAxis = a();
-    if ( majorAxis == 0.0 && type() == 1 ) majorAxis = 1.0; //catalog stars
+    double minorAxis = b();
+    if ( majorAxis == 0.0 && type() == 1 ) { //catalog stars
+      majorAxis = 1.0;
+      minorAxis = 1.0;
+    }
     double scale = SkyMap::Instance()->scale();
-    double size = majorAxis * scale * dms::PI * Options::zoomFactor()/10800.0;
+    double size = ((majorAxis + minorAxis) / 2.0 ) * scale * dms::PI * Options::zoomFactor()/10800.0;
     return 0.5*size + 4.;
 }


More information about the Kstars-devel mailing list