From a839c05c782b52b708c493fffb82e4f3e15264f1 Mon Sep 17 00:00:00 2001 From: vng Date: Tue, 15 Feb 2011 21:45:50 +0200 Subject: [PATCH] Remove BaseDrawRule::GetStrokeColor. Use only basic interface. --- indexer/drawing_rules.cpp | 4 ++-- indexer/drawing_rules.hpp | 1 - map/drawer_yg.cpp | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/indexer/drawing_rules.cpp b/indexer/drawing_rules.cpp index 9bfe68e103..bff760d7b0 100644 --- a/indexer/drawing_rules.cpp +++ b/indexer/drawing_rules.cpp @@ -573,8 +573,8 @@ namespace drule { virtual void Write(FileWriterStream & ar) const { write_rules(ar, this); } virtual double GetTextHeight() const { return m_params.get<5>().m_v; } - virtual int GetColor() const { return m_params.get<6>().m_v; } - virtual int GetStrokeColor() const {return m_params.get<8>().m_v; } + virtual int GetFillColor() const { return m_params.get<6>().m_v; } + virtual int GetColor() const {return m_params.get<8>().m_v; } static string arrKeys[9]; }; diff --git a/indexer/drawing_rules.hpp b/indexer/drawing_rules.hpp index fc13f422cc..d3b5f1c10c 100644 --- a/indexer/drawing_rules.hpp +++ b/indexer/drawing_rules.hpp @@ -55,7 +55,6 @@ namespace drule //@} virtual unsigned char GetAlpha () const { return 255; } - virtual int GetStrokeColor() const {return -1;} virtual double GetWidth() const { return -1; } virtual void GetPattern(vector &, double &) const {} virtual void GetSymbol(string &) const {} diff --git a/map/drawer_yg.cpp b/map/drawer_yg.cpp index 0e99b37df1..4c1dca924f 100644 --- a/map/drawer_yg.cpp +++ b/map/drawer_yg.cpp @@ -227,7 +227,8 @@ bool DrawerYG::filter_text_size(rule_ptr_t pRule) const void DrawerYG::drawText(m2::PointD const & pt, string const & name, rule_ptr_t pRule, int depth) { - yg::Color textColor(pRule->GetColor() == -1 ? yg::Color(0, 0, 0, 0) : yg::Color::fromXRGB(pRule->GetColor(), pRule->GetAlpha())); + int const color = pRule->GetFillColor(); + yg::Color textColor(color == -1 ? yg::Color(0, 0, 0, 0) : yg::Color::fromXRGB(color, pRule->GetAlpha())); /// to prevent white text on white outline if (textColor == yg::Color(255, 255, 255, 255)) @@ -240,7 +241,7 @@ void DrawerYG::drawText(m2::PointD const & pt, string const & name, rule_ptr_t p get_text_font_size(pRule), textColor, name, - pRule->GetStrokeColor() != -1, + pRule->GetColor() != -1, yg::Color(255, 255, 255, 255), depth, false, @@ -325,14 +326,13 @@ void DrawerYG::Draw(di::DrawInfo const * pInfo, di::DrawRule const * rules, size if (!isCaption) { - /// path is drawn separately in the code above -/* // draw path - if (isPath && !isSymbol && (pRule->GetColor() != -1)) - { - for (list::const_iterator i = pInfo->m_pathes.begin(); i != pInfo->m_pathes.end(); ++i) - drawPath(i->m_path, pRule, depth); - } - */ + // path is drawn separately in the code above + // draw path + //if (isPath && !isSymbol && (pRule->GetColor() != -1)) + //{ + // for (list::const_iterator i = pInfo->m_pathes.begin(); i != pInfo->m_pathes.end(); ++i) + // drawPath(i->m_path, pRule, depth); + //} // draw area if (isArea)