Merge lp:~alexwolf/stellarium/star-labels into lp:stellarium

Proposed by Alexander Wolf
Status: Merged
Merged at revision: 4906
Proposed branch: lp:~alexwolf/stellarium/star-labels
Merge into: lp:stellarium
Diff against target: 66 lines (+11/-2)
3 files modified
src/core/modules/Star.cpp (+6/-0)
src/core/modules/Star.hpp (+3/-0)
src/core/modules/ZoneArray.cpp (+2/-2)
To merge this branch: bzr merge lp:~alexwolf/stellarium/star-labels
Reviewer Review Type Date Requested Status
treaves Approve
Review via email: mp+65641@code.launchpad.net

Description of the change

Fix bug #515311 - displays name only for first component of multiple stars

To post a comment you must log in.
Revision history for this message
Alexander Wolf (alexwolf) wrote :

display only on the sky

Revision history for this message
treaves (treaves) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/core/modules/Star.cpp'
2--- src/core/modules/Star.cpp 2010-04-15 12:28:34 +0000
3+++ src/core/modules/Star.cpp 2011-06-23 11:31:50 +0000
4@@ -41,6 +41,12 @@
5 return QString();
6 }
7
8+int Star1::hasComponentID(void) const {
9+ if (componentIds) {
10+ return componentIds;
11+ }
12+ return 0;
13+}
14
15 static
16 int UnpackBits(bool fromBe,const char *addr,int bits_begin,
17
18=== modified file 'src/core/modules/Star.hpp'
19--- src/core/modules/Star.hpp 2010-04-15 12:28:34 +0000
20+++ src/core/modules/Star.hpp 2011-06-23 11:31:50 +0000
21@@ -75,6 +75,7 @@
22 float getBV(void) const {return IndexToBV(bV);}
23 bool hasName() const {return hip;}
24 QString getNameI18n(void) const;
25+ int hasComponentID(void) const;
26 void repack(bool fromBe);
27 void print(void);
28 }
29@@ -108,6 +109,7 @@
30 }
31 float getBV(void) const {return IndexToBV(bV);}
32 QString getNameI18n(void) const {return QString();}
33+ int hasComponentID(void) const {return 0;}
34 bool hasName() const {return false;}
35 void repack(bool fromBe);
36 void print(void);
37@@ -140,6 +142,7 @@
38 }
39 float getBV(void) const {return IndexToBV(bV);}
40 QString getNameI18n(void) const {return QString();}
41+ int hasComponentID(void) const {return 0;}
42 bool hasName() const {return false;}
43 void repack(bool fromBe);
44 void print(void);
45
46=== modified file 'src/core/modules/ZoneArray.cpp'
47--- src/core/modules/ZoneArray.cpp 2011-05-31 20:35:59 +0000
48+++ src/core/modules/ZoneArray.cpp 2011-06-23 11:31:50 +0000
49@@ -478,7 +478,7 @@
50 {
51 StelSkyDrawer* drawer = core->getSkyDrawer();
52 SpecialZoneData<Star> *const z = getZones() + index;
53- Vec3f vf;
54+ Vec3f vf;
55 const Star *const end = z->getStars() + z->size;
56 static const double d2000 = 2451545.0;
57 const double movementFactor = (M_PI/180)*(0.0001/3600) * ((core->getJDay()-d2000)/365.25) / star_position_scale;
58@@ -489,7 +489,7 @@
59 if (*tmpRcmag<=0.f)
60 break;
61 s->getJ2000Pos(z,movementFactor, vf);
62- if (drawer->drawPointSource(sPainter, vf, tmpRcmag, s->bV, !is_inside) && s->hasName() && s->mag < maxMagStarName)
63+ if (drawer->drawPointSource(sPainter, vf, tmpRcmag, s->bV, !is_inside) && s->hasName() && s->mag < maxMagStarName && s->hasComponentID()<=1)
64 {
65 const float offset = *tmpRcmag*0.7f;
66 const Vec3f& colorr = (StelApp::getInstance().getVisionModeNight() ? Vec3f(0.8f, 0.2f, 0.2f) : StelSkyDrawer::indexToColor(s->bV))*0.75f;