mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 21:13:35 +00:00
[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:
committed by
Konstantin Pastbin
parent
460a7fa480
commit
b195059fb6
@@ -839,21 +839,19 @@ void FrontendRenderer::AcceptMessage(ref_ptr<Message> message)
|
||||
m_dragBoundArea = msg->AcceptBoundArea();
|
||||
if (msg->IsEnabled())
|
||||
{
|
||||
if (!m_dragBoundArea.empty())
|
||||
auto const pt = msg->GetOptionalPosition();
|
||||
if (pt || m_dragBoundArea.empty())
|
||||
{
|
||||
PullToBoundArea(true /* randomPlace */, true /* applyZoom */);
|
||||
int zoom = kDoNotChangeZoom;
|
||||
if (GetCurrentZoom() < scales::GetAddNewPlaceScale())
|
||||
zoom = scales::GetAddNewPlaceScale();
|
||||
AddUserEvent(make_unique_dp<SetCenterEvent>(pt ? *pt : m_userEventStream.GetCurrentScreen().GlobalRect().Center(),
|
||||
zoom, true /* isAnim */, false /* trackVisibleViewport */,
|
||||
nullptr /* parallelAnimCreator */));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Exact position for POI or screen's center for Add place on map.
|
||||
int zoom = kDoNotChangeZoom;
|
||||
if (GetCurrentZoom() < scales::GetAddNewPlaceScale())
|
||||
zoom = scales::GetAddNewPlaceScale();
|
||||
|
||||
auto const pt = msg->GetOptionalPosition();
|
||||
AddUserEvent(make_unique_dp<SetCenterEvent>(pt ? *pt : m_userEventStream.GetCurrentScreen().GlobalRect().Center(),
|
||||
zoom, true /* isAnim */, false /* trackVisibleViewport */,
|
||||
nullptr /* parallelAnimCreator */));
|
||||
PullToBoundArea(true /* randomPlace */, true /* applyZoom */);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user