| 47 | } |
| 48 | |
| 49 | void DebugInfoLabels::AddLabel(ref_ptr<dp::TextureManager> tex, std::string const & caption, |
| 50 | TUpdateDebugLabelFn const & onUpdateFn) |
| 51 | { |
| 52 | std::string alphabet; |
| 53 | std::set<char> symbols; |
| 54 | AddSymbols(caption, symbols); |
| 55 | AddSymbols("0123456789.-e", symbols); |
| 56 | |
| 57 | alphabet.reserve(symbols.size()); |
| 58 | for (auto const & ch : symbols) |
| 59 | alphabet.push_back(ch); |
| 60 | |
| 61 | MutableLabelDrawer::Params params; |
| 62 | params.m_anchor = dp::LeftTop; |
| 63 | params.m_alphabet = alphabet; |
| 64 | params.m_maxLength = 100; |
| 65 | params.m_font = DrapeGui::GetGuiTextFont(); |
| 66 | params.m_font.m_color = dp::Color(0, 0, 255, 255); |
| 67 | params.m_font.m_size *= 1.2; |
| 68 | params.m_pivot = m_position.m_pixelPivot; |
| 69 | |
| 70 | #ifdef RENDER_DEBUG_INFO_LABELS |
| 71 | uint32_t const id = GuiHandleDebugLabel + m_labelsCount; |
| 72 | |
| 73 | params.m_handleCreator = [id, onUpdateFn, tex](dp::Anchor anchor, m2::PointF const & pivot) |
| 74 | { return make_unique_dp<DebugLabelHandle>(id, anchor, pivot, tex, onUpdateFn); }; |
| 75 | #endif |
| 76 | m_labelsParams.push_back(params); |
| 77 | ++m_labelsCount; |
| 78 | } |
| 79 | |
| 80 | drape_ptr<ShapeRenderer> DebugInfoLabels::Draw(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManager> tex) |
| 81 | { |
no test coverage detected