Skip to content

Commit

Permalink
Fixed trouble with selection priority of nomenclature items for
Browse files Browse the repository at this point in the history
celestial bodies in deep shadow (Fix #239)
  • Loading branch information
alex-w committed Aug 4, 2018
1 parent bef070b commit 25b4c09
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/core/modules/NomenclatureItem.cpp
Expand Up @@ -731,9 +731,16 @@ QString NomenclatureItem::getNomenclatureTypeDescription() const

float NomenclatureItem::getSelectPriority(const StelCore* core) const
{
// The item may be selectable when it over 25px size only
if (getFlagLabels() && (getAngularSize(core)*M_PI/180.*core->getProjection(StelCore::FrameJ2000)->getPixelPerRadAtCenter()>=25.))
if (planet->getVMagnitude(core)>=20.f)
{
// The planet is too faint for view (in the deep shadow for example), so let's disable select the nomenclature
return StelObject::getSelectPriority(core)+25.f;
}
else if (getFlagLabels() && (getAngularSize(core)*M_PI/180.*core->getProjection(StelCore::FrameJ2000)->getPixelPerRadAtCenter()>=25.))
{
// The item may be good selectable when it over 25px size only
return StelObject::getSelectPriority(core)-25.f;
}
else
return StelObject::getSelectPriority(core)-2.f;
}
Expand Down

0 comments on commit 25b4c09

Please sign in to comment.