From 9b32cde478e1e0b573e2db95474f3a5140977c2a Mon Sep 17 00:00:00 2001 From: Roman Sorokin Date: Tue, 5 Aug 2014 15:56:52 +0300 Subject: [PATCH] using common structures for drawing --- drape_frontend/path_text_shape.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/drape_frontend/path_text_shape.cpp b/drape_frontend/path_text_shape.cpp index e786a6d5d7..dcc1d894b1 100644 --- a/drape_frontend/path_text_shape.cpp +++ b/drape_frontend/path_text_shape.cpp @@ -106,18 +106,15 @@ void PathTextShape::Draw(dp::RefPointer batcher, dp::RefPointer batcher, dp::RefPointerInsertTriangleList(state, dp::MakeStackRefPointer(&provider), dp::MovePointer(handle)); + batcher->InsertListOfStrip(state, dp::MakeStackRefPointer(&provider), dp::MovePointer(handle), 4); } } @@ -181,9 +178,9 @@ m2::RectD PathTextHandle::GetPixelRect(ScreenBase const & screen) const { int const cnt = m_infos.size(); - Position const & v1 = m_positions[1]; - Position const & v2 = m_positions[2]; - PointF centr((v1.m_x + v2.m_x) / 2.0f, (v1.m_y + v2.m_y) / 2.0f); + vec2 const & v1 = m_positions[1]; + vec2 const & v2 = m_positions[2]; + PointF centr((v1.x + v2.x) / 2.0f, (v1.y + v2.y) / 2.0f); centr = screen.GtoP(centr); float minx, maxx, miny, maxy; minx = maxx = centr.x; @@ -191,9 +188,9 @@ m2::RectD PathTextHandle::GetPixelRect(ScreenBase const & screen) const for (int i = 1; i < cnt; i++) { - Position const & v1 = m_positions[i * 6 + 1]; - Position const & v2 = m_positions[i * 6 + 2]; - PointF centr((v1.m_x + v2.m_x) / 2.0f, (v1.m_y + v2.m_y) / 2.0f); + vec2 const & v1 = m_positions[i * 4 + 1]; + vec2 const & v2 = m_positions[i * 4 + 2]; + PointF centr((v1.x + v2.x) / 2.0f, (v1.y + v2.y) / 2.0f); centr = screen.GtoP(centr); if(centr.x > maxx) maxx = centr.x;