forked from organicmaps/organicmaps
fixed constant GPS radius bug. closes #330
This commit is contained in:
parent
9350472797
commit
96c14e00ed
2 changed files with 13 additions and 3 deletions
|
@ -73,9 +73,10 @@ namespace location
|
|||
|
||||
if ((m_flags & State::EGps) || (m_flags & State::ECompass))
|
||||
{
|
||||
pxPosition = screen.GtoP(Position()) - pxShift;
|
||||
pxErrorRadius = pxPosition.Length(screen.GtoP(Position()
|
||||
+ m2::PointD(ErrorRadius(), 0)));
|
||||
pxPosition = screen.GtoP(Position());
|
||||
pxErrorRadius = pxPosition.Length(screen.GtoP(Position() + m2::PointD(ErrorRadius(), 0)));
|
||||
|
||||
pxPosition -= pxShift;
|
||||
|
||||
if (m_flags & State::EGps)
|
||||
{
|
||||
|
|
|
@ -22,6 +22,9 @@ namespace yg
|
|||
vector<m2::PointD> pts;
|
||||
approximateArc(center, startA, endA, r, pts);
|
||||
|
||||
if (pts.size() < 2)
|
||||
return;
|
||||
|
||||
drawPath(&pts[0], pts.size(), 0, skin()->mapPenInfo(yg::PenInfo(c, 3, 0, 0, 0)), depth);
|
||||
}
|
||||
|
||||
|
@ -43,6 +46,9 @@ namespace yg
|
|||
approximateArc(center, startA, endA, r, pts);
|
||||
pts.push_back(center);
|
||||
|
||||
if (pts.size() < 3)
|
||||
return;
|
||||
|
||||
drawPath(&pts[0], pts.size(), 0, skin()->mapPenInfo(yg::PenInfo(c, 2, 0, 0, 0)), depth);
|
||||
}
|
||||
|
||||
|
@ -53,6 +59,9 @@ namespace yg
|
|||
arcPts.push_back(center);
|
||||
approximateArc(center, startA, endA, r, arcPts);
|
||||
|
||||
if (arcPts.size() < 3)
|
||||
return;
|
||||
|
||||
m2::PointD pt0 = arcPts[0];
|
||||
m2::PointD pt1 = arcPts[1];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue