[drape] Fixes add business button crosshair placement

-Point crosshair to optionalPosition instead of a random point in BoundArea

Signed-off-by: hemanggs <hemangmanhas@gmail.com>
This commit is contained in:
hemanggs
2025-07-06 23:25:14 +05:30
committed by Konstantin Pastbin
parent 460a7fa480
commit b195059fb6
2 changed files with 10 additions and 12 deletions

View File

@@ -619,7 +619,7 @@ public class PlacePageView extends Fragment
private void addOrganisation() private void addOrganisation()
{ {
((MwmActivity) requireActivity()).showPositionChooserForEditor(true, false); ((MwmActivity) requireActivity()).showPositionChooserForEditor(true, true);
} }
private void addPlace() private void addPlace()

View File

@@ -839,22 +839,20 @@ void FrontendRenderer::AcceptMessage(ref_ptr<Message> message)
m_dragBoundArea = msg->AcceptBoundArea(); m_dragBoundArea = msg->AcceptBoundArea();
if (msg->IsEnabled()) if (msg->IsEnabled())
{ {
if (!m_dragBoundArea.empty()) auto const pt = msg->GetOptionalPosition();
if (pt || m_dragBoundArea.empty())
{ {
PullToBoundArea(true /* randomPlace */, true /* applyZoom */);
}
else
{
// Exact position for POI or screen's center for Add place on map.
int zoom = kDoNotChangeZoom; int zoom = kDoNotChangeZoom;
if (GetCurrentZoom() < scales::GetAddNewPlaceScale()) if (GetCurrentZoom() < scales::GetAddNewPlaceScale())
zoom = scales::GetAddNewPlaceScale(); zoom = scales::GetAddNewPlaceScale();
auto const pt = msg->GetOptionalPosition();
AddUserEvent(make_unique_dp<SetCenterEvent>(pt ? *pt : m_userEventStream.GetCurrentScreen().GlobalRect().Center(), AddUserEvent(make_unique_dp<SetCenterEvent>(pt ? *pt : m_userEventStream.GetCurrentScreen().GlobalRect().Center(),
zoom, true /* isAnim */, false /* trackVisibleViewport */, zoom, true /* isAnim */, false /* trackVisibleViewport */,
nullptr /* parallelAnimCreator */)); nullptr /* parallelAnimCreator */));
} }
else
{
PullToBoundArea(true /* randomPlace */, true /* applyZoom */);
}
} }
break; break;
} }