From kstars-devel Thu Dec 26 15:58:04 2013 From: Jasem Mutlaq Date: Thu, 26 Dec 2013 15:58:04 +0000 To: kstars-devel Subject: [Kstars-devel] [kstars] kstars/skycomponents: Hack to fix constant crash I keep getting when zooming Message-Id: X-MARC-Message: https://marc.info/?l=kstars-devel&m=138807351307331 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@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 ); + } } } _______________________________________________ Kstars-devel mailing list Kstars-devel@kde.org https://mail.kde.org/mailman/listinfo/kstars-devel