small fixes

This commit is contained in:
Roman Sorokin 2014-07-29 15:38:09 +03:00 committed by Alex Zolotarev
parent 8171f4f76e
commit 34c67ad4f1
2 changed files with 5 additions and 6 deletions

View file

@ -231,7 +231,7 @@ void PathTextHandle::Update(ScreenBase const & screen)
Spline::iterator itr;
itr.Attach(m_path);
itr.Step(m_params.m_OffsetStart * m_scaleFactor);
itr.Step(entireLength);
for (int i = 0; i < cnt; i++)
{
@ -251,10 +251,12 @@ void PathTextHandle::Update(ScreenBase const & screen)
itr.Step(advance);
PointF dir = itr.m_avrDir.Normalize();
PointF norm(-dir.y, dir.x);
PointF norm2 = norm;
dir *= halfWidth * m_scaleFactor;
norm *= halfHeight * m_scaleFactor;
PointF const pivot = dir * xOffset / halfWidth + norm * yOffset / halfHeight + pos;
float const fontSize = m_params.m_TextFont.m_size * m_scaleFactor / 2.0f;
PointF const pivot = dir * xOffset / halfWidth + norm * yOffset / halfHeight + pos + norm2 * fontSize;
PointF const p1 = pivot + dir - norm;
PointF const p2 = pivot - dir - norm;

View file

@ -62,10 +62,7 @@ public:
: OverlayHandle(FeatureID(), dp::Center, 0.0f),
m_params(params), m_path(spl), m_infos(info),
m_scaleFactor(1.0f), m_positions(info.size() * 6),
m_maxSize(maxSize)
{
SetIsVisible(true);
}
m_maxSize(maxSize) {}
virtual void Update(ScreenBase const & screen);
virtual m2::RectD GetPixelRect(ScreenBase const & screen) const;