MCPcopy Create free account
hub / github.com/comaps/comaps / CalculateLayout

Method CalculateLayout

libs/drape_frontend/path_text_shape.cpp:37–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37bool PathTextShape::CalculateLayout(ref_ptr<dp::TextureManager> textures)
38{
39 char constexpr kSpaces[] = " ";
40 auto layout = make_unique_dp<PathTextLayout>(
41 m_params.m_tileCenter,
42 m_params.m_auxText.empty() ? m_params.m_mainText : m_params.m_mainText + kSpaces + m_params.m_auxText,
43 m_params.m_textFont.m_size, textures, m_params.m_mainTextLanguageIndex);
44
45 if (0 == layout->GetGlyphCount())
46 {
47 LOG(LWARNING, ("Empty layout for main text", m_params.m_mainText, "and aux text", m_params.m_auxText));
48 return false;
49 }
50
51 m_context->SetLayout(std::move(layout), m_params.m_baseGtoPScale);
52
53 return !m_context->GetOffsets().empty();
54}
55
56uint64_t PathTextShape::GetOverlayPriority(uint32_t textIndex, size_t textLength) const
57{

Callers 1

Calls 4

GetGlyphCountMethod · 0.80
GetOffsetsMethod · 0.80
emptyMethod · 0.45
SetLayoutMethod · 0.45

Tested by

no test coverage detected