From 05ef929575af77ca95b508912f520e45fbdc0875 Mon Sep 17 00:00:00 2001 From: rachytski Date: Fri, 18 Jan 2013 12:55:55 +0300 Subject: [PATCH] fixed path offset processing in drawSymbolPath. --- graphics/path_renderer.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/graphics/path_renderer.cpp b/graphics/path_renderer.cpp index 3688a6bc16..ef5ca202a2 100644 --- a/graphics/path_renderer.cpp +++ b/graphics/path_renderer.cpp @@ -59,6 +59,11 @@ namespace graphics PathPoint pt = pv.front(); + double step = pen->m_info.m_step; + + if (offset < 0) + offset = fmod(offset, step); + pt = pv.offsetPoint(pt, offset); m2::RectU texRect = pen->m_texRect; @@ -70,6 +75,14 @@ namespace graphics double const hw = w / 2.0; double const hh = h / 2.0; + /// do not render start symbol if it's + /// completely outside the first segment. + if (offset + w < 0) + { + pv.offsetPoint(pt, step); + offset += step; + } + shared_ptr tex = pipeline(pen->m_pipelineID).texture(); while (true)