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:
authorvng <viktor.govako@gmail.com>2011-11-17 00:22:45 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:28:13 +0300
commite8975ebcbf8e34d1bd71cce114bd035a7d51d183 (patch)
treee8d42b0b9730c2c96e3ab974ec0840579a087804 /indexer/drawing_rules.cpp
parent43738118867defa5d28243853c5677b789fa08d5 (diff)
Add PathTextRuleProto for text-by-line.
Regenerate proto drawing rules. Take into account correct rule color for text-by-line drawing.
Diffstat (limited to 'indexer/drawing_rules.cpp')
-rw-r--r--indexer/drawing_rules.cpp41
1 files changed, 35 insertions, 6 deletions
diff --git a/indexer/drawing_rules.cpp b/indexer/drawing_rules.cpp
index 49cc03ecb4..e1b15b2160 100644
--- a/indexer/drawing_rules.cpp
+++ b/indexer/drawing_rules.cpp
@@ -648,7 +648,7 @@ namespace drule {
virtual void Write(FileWriterStream & ar) const { write_rules(ar, this); }
virtual double GetTextHeight() const { return m_params.get<6>().m_v; }
- virtual int GetColor() const {return m_params.get<7>().m_v;}
+ virtual int GetFillColor() const {return m_params.get<7>().m_v;}
static string arrKeys[10];
};
@@ -1149,13 +1149,18 @@ namespace
void ConvertImpl(BaseRule const * pSrc, CaptionRuleProto * pDest) const
{
pDest->set_height(ToPixels(pSrc->GetTextHeight()));
+ pDest->set_color(GetFillColor(pSrc));
- if (pSrc->GetFillColor() != -1)
- pDest->set_color(GetFillColor(pSrc));
if (pSrc->GetColor() != -1)
pDest->set_stroke_color(GetColor(pSrc));
}
+ void ConvertImpl(BaseRule const * pSrc, PathTextRuleProto * pDest) const
+ {
+ pDest->set_height(ToPixels(pSrc->GetTextHeight()));
+ pDest->set_color(GetFillColor(pSrc));
+ }
+
void ConvertImpl(BaseRule const * pSrc, CircleRuleProto * pDest) const
{
pDest->set_radius(ToPixels(pSrc->GetRadius()));
@@ -1228,12 +1233,13 @@ namespace
Convert(pRule, keys[i].m_priority, pDE->mutable_symbol());
break;
case caption:
- case pathtext:
Convert(pRule, keys[i].m_priority, pDE->mutable_caption());
break;
case circle:
Convert(pRule, keys[i].m_priority, pDE->mutable_circle());
break;
+ case pathtext:
+ Convert(pRule, keys[i].m_priority, pDE->mutable_path_text());
}
}
}
@@ -1329,7 +1335,7 @@ namespace
{
return m_area.color();
}
- virtual unsigned char GetAlpha () const
+ virtual unsigned char GetAlpha() const
{
return AlphaFromColor(GetFillColor());
}
@@ -1382,7 +1388,7 @@ namespace
{
return m_caption.height();
}
- virtual unsigned char GetAlpha () const
+ virtual unsigned char GetAlpha() const
{
return AlphaFromColor(GetFillColor());
}
@@ -1403,6 +1409,26 @@ namespace
return m_circle.radius();
}
};
+
+ class PathText : public MyBase
+ {
+ PathTextRuleProto m_text;
+ public:
+ PathText(PathTextRuleProto const & r) : m_text(r) {}
+
+ virtual int GetFillColor() const
+ {
+ return m_text.color();
+ }
+ virtual double GetTextHeight() const
+ {
+ return m_text.height();
+ }
+ virtual unsigned char GetAlpha() const
+ {
+ return AlphaFromColor(GetFillColor());
+ }
+ };
}
class DoSetIndex
@@ -1511,6 +1537,9 @@ namespace
if (de.has_circle())
AddRule<Circle>(p, de.scale(), circle, de.circle());
+
+ if (de.has_path_text())
+ AddRule<PathText>(p, de.scale(), pathtext, de.path_text());
}
}