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:
authorRoman Sorokin <sorok-roma@yandex.ru>2014-09-24 11:45:53 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:27:28 +0300
commit768f823431f0c3cf6b49c5985a0f2778cf2b5538 (patch)
tree639d588ef4da85f51f6f2bae22f4a3c6adb9c428 /drape_frontend
parentbe81dbef1df122adb5b78a4d20b02085738abf21 (diff)
Reading pattern line
Diffstat (limited to 'drape_frontend')
-rw-r--r--drape_frontend/apply_feature_functors.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/drape_frontend/apply_feature_functors.cpp b/drape_frontend/apply_feature_functors.cpp
index 90eadde06c..121ac598c7 100644
--- a/drape_frontend/apply_feature_functors.cpp
+++ b/drape_frontend/apply_feature_functors.cpp
@@ -16,6 +16,7 @@
#include "../std/algorithm.hpp"
#include "../drape/color.hpp"
+#include "../drape/stipple_pen_resource.hpp"
#include "../graphics/defines.hpp"
@@ -33,8 +34,19 @@ dp::Color ToDrapeColor(uint32_t src)
void Extract(::LineDefProto const * lineRule,
df::LineViewParams & params)
{
+ float const scale = df::VisualParams::Instance().GetVisualScale();
params.m_color = ToDrapeColor(lineRule->color());
- params.m_width = max(lineRule->width() * df::VisualParams::Instance().GetVisualScale(), 1.0);
+ params.m_width = max(lineRule->width() * scale, 1.0);
+
+ if (lineRule->has_dashdot())
+ {
+ DashDotProto const & dd = lineRule->dashdot();
+
+ int const count = dd.dd_size();
+ params.m_key.m_pattern.reserve(count);
+ for (int i = 0; i < count; ++i)
+ params.m_key.m_pattern.push_back(dd.dd(i) * scale);
+ }
switch(lineRule->cap())
{
@@ -334,7 +346,10 @@ void ApplyLineFeature::ProcessRule(Stylist::rule_wrapper_t const & rule)
LineViewParams params;
Extract(pLineRule, params);
params.m_depth = depth;
- m_context.InsertShape(m_tileKey, dp::MovePointer<MapShape>(new LineShape(m_spline->GetPath(), params)));
+ if (params.m_key.m_pattern.empty())
+ m_context.InsertShape(m_tileKey, dp::MovePointer<MapShape>(new LineShape(m_spline->GetPath(), params)));
+ else
+ m_context.InsertShape(m_tileKey, dp::MovePointer<MapShape>(new LineShape(m_spline->GetPath(), params, m_currentScaleGtoP)));
}
}
}