diff options
author | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2016-06-21 13:18:50 +0300 |
---|---|---|
committer | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2016-07-07 15:31:09 +0300 |
commit | e2543477a6425ec36a4fe4088bd255d6f916becc (patch) | |
tree | 5e54bea90cc2a72e3e3bb666032b42956afe034b /drape_frontend | |
parent | 74e5ac5cb9a8a5ba0b0aa9d84dfb17d410610373 (diff) |
Set center fixed.
Diffstat (limited to 'drape_frontend')
-rw-r--r-- | drape_frontend/user_event_stream.cpp | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/drape_frontend/user_event_stream.cpp b/drape_frontend/user_event_stream.cpp index 0f7c91dbbd..64169b209a 100644 --- a/drape_frontend/user_event_stream.cpp +++ b/drape_frontend/user_event_stream.cpp @@ -372,22 +372,6 @@ bool UserEventStream::SetCenter(m2::PointD const & center, int zoom, bool isAnim ScreenBase const & currentScreen = GetCurrentScreen(); ScreenBase screen = currentScreen; - bool finishIn2d = false; - bool finishIn3d = false; - if (zoom != kDoNotChangeZoom) - { - bool const isScaleAllowableIn3d = IsScaleAllowableIn3d(zoom); - finishIn3d = m_discardedFOV > 0.0 && isScaleAllowableIn3d; - finishIn2d = currentScreen.isPerspective() && !isScaleAllowableIn3d; - - if (finishIn3d) - screen.ApplyPerspective(m_discardedAngle, m_discardedAngle, m_discardedFOV); - else if (finishIn2d) - screen.ResetPerspective(); - } - - double const scale3d = screen.GetScale3d(); - if (zoom == kDoNotChangeZoom) { m2::AnyRectD const r = GetTargetRect(); @@ -398,6 +382,7 @@ bool UserEventStream::SetCenter(m2::PointD const & center, int zoom, bool isAnim { angle = screen.GlobalRect().Angle(); + double scale3d = kDefault3dScale;//screen.CalculateScale3d(screen.CalculatePerspectiveAngle()); localRect = df::GetRectForDrawScale(zoom, center); localRect.Scale(scale3d); @@ -413,23 +398,6 @@ bool UserEventStream::SetCenter(m2::PointD const & center, int zoom, bool isAnim localRect.Inflate(localRect.SizeX() * 0.5 / aspectRatio, 0.0); } - if (screen.isPerspective()) - { - double const centerOffset3d = localRect.SizeY() * (1.0 - 1.0 / (scale3d * cos(screen.GetRotationAngle()))) * 0.5; - targetCenter = targetCenter.Move(centerOffset3d, angle.cos(), -angle.sin()); - } - - if (finishIn2d || finishIn3d) - { - double const scale = currentScreen.PixelRect().SizeX() / currentScreen.PixelRectIn3d().SizeX(); - double const scaleToCurrent = finishIn2d ? scale : 1.0 / scale3d; - - double const currentGSizeY = localRect.SizeY() * scaleToCurrent; - targetCenter = targetCenter.Move((currentGSizeY - localRect.SizeY()) * 0.5, - angle.cos(), -angle.sin()); - localRect.Scale(scaleToCurrent); - } - return SetRect(m2::AnyRectD(targetCenter, angle, localRect), isAnim); } |