[drape] Added assert.

Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
Viktor Govako 2022-11-27 19:59:21 +03:00
parent 9deaa9c9eb
commit a1ab99952b

View file

@ -515,6 +515,7 @@ void ApplyPointFeature::Finish(ref_ptr<dp::TextureManager> texMng)
params.m_minVisibleScale = m_minVisibleScale;
params.m_rank = m_rank;
params.m_symbolName = m_symbolRule->name();
ASSERT_GREATER_OR_EQUAL(m_symbolRule->min_distance(), 0, ());
params.m_extendingSize = static_cast<uint32_t>(mainScale * m_symbolRule->min_distance() * poiExtendScale);
params.m_posZ = m_posZ;
params.m_hasArea = m_hasArea;
@ -1145,12 +1146,13 @@ void ApplyLineFeatureAdditional::Finish(ref_ptr<dp::TextureManager> texMng,
if (shieldPositions.empty())
return;
// Set default shield's icon min distance.
ASSERT(m_shieldRule != nullptr, ());
int constexpr kDefaultMinDistance = 50;
int minDistance = m_shieldRule->min_distance() != 0 ? m_shieldRule->min_distance()
: kDefaultMinDistance;
if (minDistance < 0)
minDistance = kDefaultMinDistance;
int minDistance = m_shieldRule->min_distance();
ASSERT_GREATER_OR_EQUAL(minDistance, 0, ());
if (minDistance <= 0)
minDistance = 50;
uint32_t const scaledMinDistance = static_cast<uint32_t>(vs * minDistance);
uint8_t shieldIndex = 0;