diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2016-09-01 18:13:15 +0300 |
---|---|---|
committer | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2016-09-02 16:40:15 +0300 |
commit | feda627f30fd97b62f904c43ca3c8f3f1e608ca0 (patch) | |
tree | 8dcc86ab477a17a74dd4014158c3d3dc8429c489 /drape_frontend/text_layout.cpp | |
parent | 4737649abe7a822453999dafa3563a5423833b84 (diff) |
Added tile-based model-view
Diffstat (limited to 'drape_frontend/text_layout.cpp')
-rw-r--r-- | drape_frontend/text_layout.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drape_frontend/text_layout.cpp b/drape_frontend/text_layout.cpp index d38f88f380..545dfa3878 100644 --- a/drape_frontend/text_layout.cpp +++ b/drape_frontend/text_layout.cpp @@ -1,6 +1,5 @@ #include "drape_frontend/text_layout.hpp" -#include "drape_frontend/visual_params.hpp" - +#include "drape_frontend/map_shape.hpp" #include "drape_frontend/visual_params.hpp" #include "drape/fribidi.hpp" @@ -436,8 +435,9 @@ void StraightTextLayout::Cache(glm::vec4 const & pivot, glm::vec2 const & pixelO } } -PathTextLayout::PathTextLayout(strings::UniString const & text, float fontSize, - ref_ptr<dp::TextureManager> textures) +PathTextLayout::PathTextLayout(m2::PointD const & tileCenter, strings::UniString const & text, + float fontSize, ref_ptr<dp::TextureManager> textures) + : m_tileCenter(tileCenter) { Init(fribidi::log2vis(text), fontSize, textures); } @@ -481,6 +481,8 @@ bool PathTextLayout::CacheDynamicGeometry(m2::Spline::iterator const & iter, flo glsl::vec2 pxPivot = glsl::ToVec2(iter.m_pos); buffer.resize(4 * m_metrics.size()); + + glsl::vec4 const pivot(glsl::ToVec2(MapShape::ConvertPt(globalPivot, m_tileCenter, kShapeCoordScalar)), depth, 0.0f); for (size_t i = 0; i < m_metrics.size(); ++i) { GlyphRegion const & g = m_metrics[i]; @@ -501,7 +503,6 @@ bool PathTextLayout::CacheDynamicGeometry(m2::Spline::iterator const & iter, flo size_t baseIndex = 4 * i; - glsl::vec4 pivot(glsl::ToVec2(globalPivot), depth, 0.0f); buffer[baseIndex + 0] = gpu::TextDynamicVertex(pivot, formingVector + normal * bottomVector + tangent * xOffset); buffer[baseIndex + 1] = gpu::TextDynamicVertex(pivot, formingVector + normal * upVector + tangent * xOffset); buffer[baseIndex + 2] = gpu::TextDynamicVertex(pivot, formingVector + normal * bottomVector + tangent * (pxSize.x + xOffset)); |