MCPcopy Create free account
hub / github.com/comaps/comaps / PullToBoundArea

Method PullToBoundArea

libs/drape_frontend/frontend_renderer.cpp:1283–1300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1281}
1282
1283void FrontendRenderer::PullToBoundArea(bool randomPlace, bool applyZoom)
1284{
1285 if (m_dragBoundArea.empty())
1286 return;
1287
1288 ScreenBase const & screen = m_userEventStream.GetCurrentScreen();
1289 m2::PointD const center = screen.GlobalRect().Center();
1290 if (!m2::IsPointInsideTriangles(center, m_dragBoundArea))
1291 {
1292 m2::PointD const dest = randomPlace ? m2::GetRandomPointInsideTriangles(m_dragBoundArea)
1293 : m2::ProjectPointToTriangles(center, m_dragBoundArea);
1294 int zoom = kDoNotChangeZoom;
1295 if (applyZoom && GetCurrentZoom() < scales::GetAddNewPlaceScale())
1296 zoom = scales::GetAddNewPlaceScale();
1297 AddUserEvent(make_unique_dp<SetCenterEvent>(dest, zoom, true /* isAnim */, false /* trackVisibleViewport */,
1298 nullptr /* parallelAnimCreator */));
1299 }
1300}
1301
1302void FrontendRenderer::ProcessSelection(ref_ptr<SelectObjectMessage> msg)
1303{

Callers

nothing calls this directly

Calls 7

IsPointInsideTrianglesFunction · 0.85
ProjectPointToTrianglesFunction · 0.85
GetAddNewPlaceScaleFunction · 0.85
GetCurrentScreenMethod · 0.80
emptyMethod · 0.45
CenterMethod · 0.45

Tested by

no test coverage detected