forked from organicmaps/organicmaps
Select POI in 3d.
Conflicts: map/framework.cpp map/framework.hpp
This commit is contained in:
parent
9a9f89d22c
commit
f2100e2427
3 changed files with 10 additions and 7 deletions
|
@ -309,7 +309,9 @@ void FrontendRenderer::AcceptMessage(ref_ptr<Message> message)
|
|||
case Message::FindVisiblePOI:
|
||||
{
|
||||
ref_ptr<FindVisiblePOIMessage> msg = message;
|
||||
msg->SetFeatureID(GetVisiblePOI(m_userEventStream.GetCurrentScreen().GtoP(msg->GetPoint())));
|
||||
ScreenBase const & screen = m_userEventStream.GetCurrentScreen();
|
||||
msg->SetFeatureID(GetVisiblePOI(screen.isPerspective() ? screen.PtoP3d(screen.GtoP(msg->GetPoint()))
|
||||
: screen.GtoP(msg->GetPoint())));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -1455,7 +1455,7 @@ m2::PointD Framework::GetVisiblePOI(FeatureID const & id, search::AddressInfo &
|
|||
|
||||
GetAddressInfo(ft, center, info);
|
||||
|
||||
return GtoP(center);
|
||||
return m_currentModelView.isPerspective() ? GtoP3d(center) : GtoP(center);
|
||||
}
|
||||
|
||||
namespace
|
||||
|
@ -1639,7 +1639,7 @@ void Framework::InvalidateRendering()
|
|||
|
||||
UserMark const * Framework::OnTapEventImpl(m2::PointD pxPoint, bool isLong, bool isMyPosition, FeatureID const & feature)
|
||||
{
|
||||
pxPoint = m_currentMovelView.P3dToP(pxPoint);
|
||||
m2::PointD const pxPoint2d = m_currentModelView.P3dToP(pxPoint);
|
||||
|
||||
if (isMyPosition)
|
||||
{
|
||||
|
@ -1655,13 +1655,13 @@ UserMark const * Framework::OnTapEventImpl(m2::PointD pxPoint, bool isLong, bool
|
|||
|
||||
m2::AnyRectD rect;
|
||||
uint32_t const touchRadius = vp.GetTouchRectRadius();
|
||||
m_currentModelView.GetTouchRect(pxPoint, touchRadius, rect);
|
||||
m_currentModelView.GetTouchRect(pxPoint2d, touchRadius, rect);
|
||||
|
||||
m2::AnyRectD bmSearchRect;
|
||||
double const bmAddition = BM_TOUCH_PIXEL_INCREASE * vp.GetVisualScale();
|
||||
double const pxWidth = touchRadius;
|
||||
double const pxHeight = touchRadius + bmAddition;
|
||||
m_currentModelView.GetTouchRect(pxPoint + m2::PointD(0, bmAddition),
|
||||
m_currentModelView.GetTouchRect(pxPoint2d + m2::PointD(0, bmAddition),
|
||||
pxWidth, pxHeight, bmSearchRect);
|
||||
UserMark const * mark = m_bmManager.FindNearestUserMark(
|
||||
[&rect, &bmSearchRect](UserMarkType type) -> m2::AnyRectD const &
|
||||
|
@ -1684,7 +1684,7 @@ UserMark const * Framework::OnTapEventImpl(m2::PointD pxPoint, bool isLong, bool
|
|||
}
|
||||
else if (isLong)
|
||||
{
|
||||
GetAddressInfoForPixelPoint(pxPoint, info);
|
||||
GetAddressInfoForPixelPoint(pxPoint2d, info);
|
||||
pxPivot = pxPoint;
|
||||
needMark = true;
|
||||
}
|
||||
|
@ -1692,7 +1692,7 @@ UserMark const * Framework::OnTapEventImpl(m2::PointD pxPoint, bool isLong, bool
|
|||
if (needMark)
|
||||
{
|
||||
PoiMarkPoint * poiMark = UserMarkContainer::UserMarkForPoi();
|
||||
poiMark->SetPtOrg(m_currentModelView.PtoG(pxPivot));
|
||||
poiMark->SetPtOrg(m_currentModelView.PtoG(m_currentModelView.P3dToP(pxPivot)));
|
||||
poiMark->SetInfo(info);
|
||||
poiMark->SetMetadata(move(metadata));
|
||||
return poiMark;
|
||||
|
|
|
@ -377,6 +377,7 @@ public:
|
|||
//@{
|
||||
inline m2::PointD PtoG(m2::PointD const & p) const { return m_currentModelView.PtoG(p); }
|
||||
inline m2::PointD GtoP(m2::PointD const & p) const { return m_currentModelView.GtoP(p); }
|
||||
inline m2::PointD GtoP3d(m2::PointD const & p) const { return m_currentModelView.PtoP3d(m_currentModelView.GtoP(p)); }
|
||||
|
||||
void SaveState();
|
||||
void LoadState();
|
||||
|
|
Loading…
Add table
Reference in a new issue