From 5b0d77fcfa8b78cf47c6f014ac6d89d5550b3762 Mon Sep 17 00:00:00 2001 From: rachytski Date: Sat, 4 Jun 2011 18:01:08 +0300 Subject: [PATCH] moved path text filtering into TextRenderer --- map/drawer_yg.cpp | 28 +++------------------------- map/drawer_yg.hpp | 3 --- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/map/drawer_yg.cpp b/map/drawer_yg.cpp index 383098c2ae..734434a3a0 100644 --- a/map/drawer_yg.cpp +++ b/map/drawer_yg.cpp @@ -77,7 +77,6 @@ void DrawerYG::beginFrame() void DrawerYG::endFrame() { m_pScreen->endFrame(); - m_pathsOrg.clear(); } void DrawerYG::clear(yg::Color const & c, bool clearRT, float depth, bool clearDepth) @@ -413,33 +412,12 @@ void DrawerYG::Draw(di::DrawInfo const * pInfo, di::DrawRule const * rules, size // draw way name if (isPath && !isArea && isN && !filter_text_size(pRule)) { - uint8_t const fontSize = get_pathtext_font_size(pRule); - list & lst = m_pathsOrg[pInfo->m_name]; - for (list::const_iterator i = pInfo->m_pathes.begin(); i != pInfo->m_pathes.end(); ++i) { - m2::RectD r = i->GetLimitRect(); - r.Inflate(-r.SizeX() / 4.0, -r.SizeY() / 4.0); - r.Inflate(fontSize, fontSize); + if (filter_text_size(pRule)) + continue; - bool needDraw = true; - for (list::const_iterator j = lst.begin(); j != lst.end(); ++j) - if (r.IsIntersect(*j)) - { - needDraw = false; - break; - } - - if (needDraw) - { - if (drawPathText(*i, pInfo->m_name, fontSize, depth)) - { - isNumber = false; // text hides number - lst.push_back(r); - } - } - else - isNumber = false; // neighbor text hides this text and this number + drawPathText(*i, pInfo->m_name, get_pathtext_font_size(pRule), depth); } } diff --git a/map/drawer_yg.hpp b/map/drawer_yg.hpp index f2c03b3b9d..f95104bb68 100644 --- a/map/drawer_yg.hpp +++ b/map/drawer_yg.hpp @@ -72,9 +72,6 @@ class DrawerYG static void ClearSkinPage(uint8_t pageID); - typedef map > org_map_t; - org_map_t m_pathsOrg; - protected: void drawSymbol(m2::PointD const & pt, rule_ptr_t pRule, yg::EPosition pos, int depth); void drawCircle(m2::PointD const & pt, rule_ptr_t pRule, yg::EPosition pos, int depth);