Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoliy Tomilov <tomilovanatoliy@gmail.com>2020-08-06 11:16:23 +0300
committerTatiana Yan <tatiana.kondakova@gmail.com>2020-08-14 10:57:03 +0300
commitae69fde1783aa2d19f7441f69c5e05160e1783cd (patch)
tree0759a13f24d04d0d04cec1f742042a23dd01d434 /drape_frontend/user_mark_shapes.cpp
parent627e6811e5dc11bf8aad4f16b82de00e57b5564e (diff)
[drape] [Booking] Introduce special visual representation for unavailable Booking hotels MAPSME-14325
- Add selection option to Booking search marks - Add forceNoWrap option to StraitTextLayout - Track "unavailable" status for search marks - Make special handling for selection of Booking search marks via special badges having strokes - Track "selected" status for search marks - Handle "preparing" status for Booking search marks - Remove extra colors from Booking search marks color scheme - Refactor SearchMarkPoint
Diffstat (limited to 'drape_frontend/user_mark_shapes.cpp')
-rw-r--r--drape_frontend/user_mark_shapes.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/drape_frontend/user_mark_shapes.cpp b/drape_frontend/user_mark_shapes.cpp
index 8b6076ac2b..d5be528127 100644
--- a/drape_frontend/user_mark_shapes.cpp
+++ b/drape_frontend/user_mark_shapes.cpp
@@ -152,6 +152,7 @@ void GenerateColoredSymbolShapes(ref_ptr<dp::GraphicsContext> context, ref_ptr<d
if (isTextBg)
{
+ CHECK(renderInfo.m_titleDecl, ());
auto const & titleDecl = renderInfo.m_titleDecl->at(0);
auto textLayout = MakePrimaryTextLayout(titleDecl, textures);
sizeInc.x = textLayout.GetPixelLength();
@@ -248,25 +249,27 @@ void GeneratePoiSymbolShape(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::Te
if (renderInfo.m_badgeInfo)
{
params.m_maskColor = renderInfo.m_badgeInfo->m_maskColor;
- if (renderInfo.m_badgeInfo->m_badgeTitleIndex)
+ if (renderInfo.m_titleDecl != nullptr && renderInfo.m_badgeInfo->m_badgeTitleIndex &&
+ renderInfo.m_minTitleZoom <= tileKey.m_zoomLevel)
{
size_t const badgeTitleIndex = *renderInfo.m_badgeInfo->m_badgeTitleIndex;
- CHECK_LESS(badgeTitleIndex, renderInfo.m_titleDecl->size(), ());
-
- dp::TitleDecl const & titleDecl = (*renderInfo.m_titleDecl)[badgeTitleIndex];
- TextLayout textLayout = MakePrimaryTextLayout(titleDecl, textures);
- float const textWidth = textLayout.GetPixelLength();
+ if (badgeTitleIndex < renderInfo.m_titleDecl->size())
+ {
+ dp::TitleDecl const & titleDecl = (*renderInfo.m_titleDecl)[badgeTitleIndex];
+ TextLayout textLayout = MakePrimaryTextLayout(titleDecl, textures);
+ float const textWidth = textLayout.GetPixelLength();
- dp::TextureManager::SymbolRegion region;
- textures->GetSymbolRegion(symbolName, region);
- float const pixelHalfWidth = 0.5f * region.GetPixelSize().x;
+ dp::TextureManager::SymbolRegion region;
+ textures->GetSymbolRegion(symbolName, region);
+ float const pixelHalfWidth = 0.5f * region.GetPixelSize().x;
- float constexpr kBadgeSpecialMarginsAdjustmentMultplier = 4.0f;
- float const badgeSpecialMarginsAdjustment =
- kBadgeSpecialMarginsAdjustmentMultplier * titleDecl.m_primaryOffset.x;
+ float constexpr kBadgeMarginsAdjustmentFactor = 4.0f;
+ float const badgeMarginsAdjustment =
+ kBadgeMarginsAdjustmentFactor * titleDecl.m_primaryOffset.x;
- params.m_pixelWidth = 3.0f * pixelHalfWidth + textWidth + badgeSpecialMarginsAdjustment;
- params.m_offset.x += 0.5f * (pixelHalfWidth + textWidth + badgeSpecialMarginsAdjustment);
+ params.m_pixelWidth = 3.0f * pixelHalfWidth + textWidth + badgeMarginsAdjustment;
+ params.m_offset.x += 0.5f * (pixelHalfWidth + textWidth + badgeMarginsAdjustment);
+ }
}
}