[Kstars-devel] [kstars] kstars/skycomponents: Hack to fix constant crash I keep getting when zooming in and out. There is a problem with comet magnitude it is sometimes returned as NAN and this leads
Jasem Mutlaq
mutlaqja at ikarustech.com
Thu Dec 26 15:58:04 UTC 2013
Git commit 0aad797c21d8dd59c70f655d62f4f85f4d5fad17 by Jasem Mutlaq.
Committed on 26/12/2013 at 15:56.
Pushed by mutlaqja into branch 'master'.
Hack to fix constant crash I keep getting when zooming in and out. There is a problem with comet magnitude it is sometimes returned as NAN and this leads
to a crash subsequently. Please investigate this further.
CCMAIL:kstars-devel at kde.org
M +7 -3 kstars/skycomponents/cometscomponent.cpp
http://commits.kde.org/kstars/0aad797c21d8dd59c70f655d62f4f85f4d5fad17
diff --git a/kstars/skycomponents/cometscomponent.cpp b/kstars/skycomponents/cometscomponent.cpp
index fdd241f..e3b6540 100644
--- a/kstars/skycomponents/cometscomponent.cpp
+++ b/kstars/skycomponents/cometscomponent.cpp
@@ -190,9 +190,13 @@ void CometsComponent::draw( SkyPainter *skyp )
foreach ( SkyObject *so, m_ObjectList ) {
KSComet *com = (KSComet*)so;
- bool drawn = skyp->drawPointSource(com,com->mag());
- if ( drawn && !(hideLabels || com->rsun() >= rsunLabelLimit) )
- SkyLabeler::AddLabel( com, SkyLabeler::COMET_LABEL );
+ double mag= com->mag();
+ if (isnan(mag) == 0)
+ {
+ bool drawn = skyp->drawPointSource(com,mag);
+ if ( drawn && !(hideLabels || com->rsun() >= rsunLabelLimit) )
+ SkyLabeler::AddLabel( com, SkyLabeler::COMET_LABEL );
+ }
}
}
More information about the Kstars-devel
mailing list