| 1976 | } |
| 1977 | |
| 1978 | void FrontendRenderer::OnTap(m2::PointD const & pt, bool isLongTap) |
| 1979 | { |
| 1980 | if (m_blockTapEvents) |
| 1981 | return; |
| 1982 | |
| 1983 | double const halfSize = VisualParams::Instance().GetTouchRectRadius(); |
| 1984 | m2::PointD sizePoint(halfSize, halfSize); |
| 1985 | m2::RectD selectRect(pt - sizePoint, pt + sizePoint); |
| 1986 | |
| 1987 | ScreenBase const & screen = m_userEventStream.GetCurrentScreen(); |
| 1988 | bool isMyPosition = false; |
| 1989 | |
| 1990 | m2::PointD const pxPoint2d = screen.P3dtoP(pt); |
| 1991 | m2::PointD mercator = screen.PtoG(pxPoint2d); |
| 1992 | |
| 1993 | // Long tap should show/hide the interface. There is no need to detect tapped features. |
| 1994 | if (isLongTap) |
| 1995 | { |
| 1996 | m_tapEventInfoHandler({mercator, isLongTap, isMyPosition, FeatureID(), kml::kInvalidMarkId}); |
| 1997 | return; |
| 1998 | } |
| 1999 | |
| 2000 | if (m_myPositionController->IsModeHasPosition()) |
| 2001 | { |
| 2002 | m2::PointD const pixelPos = screen.PtoP3d(screen.GtoP(m_myPositionController->Position())); |
| 2003 | isMyPosition = selectRect.IsPointInside(pixelPos); |
| 2004 | if (isMyPosition) |
| 2005 | mercator = m_myPositionController->Position(); |
| 2006 | } |
| 2007 | |
| 2008 | ASSERT(m_tapEventInfoHandler != nullptr, ()); |
| 2009 | auto [featureId, markId] = GetVisiblePOI(selectRect); |
| 2010 | m_tapEventInfoHandler({mercator, isLongTap, isMyPosition, featureId, markId}); |
| 2011 | } |
| 2012 | |
| 2013 | void FrontendRenderer::OnForceTap(m2::PointD const & pt) |
| 2014 | { |
nothing calls this directly
no test coverage detected