diff options
author | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2016-05-30 14:51:58 +0300 |
---|---|---|
committer | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2016-07-07 15:31:06 +0300 |
commit | fb39e154fe53384ddbb857681065248abb6792f4 (patch) | |
tree | 4fc0bb92a90df958e1008a6561bdd4cf7bf51fed /drape_frontend/screen_operations.cpp | |
parent | 037a39d938ddac66326fa9aad172cf073b0d904f (diff) |
Follow animation operates with pixel positions on viewport.
Diffstat (limited to 'drape_frontend/screen_operations.cpp')
-rw-r--r-- | drape_frontend/screen_operations.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drape_frontend/screen_operations.cpp b/drape_frontend/screen_operations.cpp index acc083dedc..5060097425 100644 --- a/drape_frontend/screen_operations.cpp +++ b/drape_frontend/screen_operations.cpp @@ -272,4 +272,16 @@ bool ApplyScale(m2::PointD const & pixelScaleCenter, double factor, ScreenBase & return true; } +double CalculatePerspectiveAngle(ScreenBase const & screen) +{ + double const kStartPerspectiveScale = 0.5; + double const kMaxScale = 0.2; + double const kMaxPerspectiveAngle = math::pi4; + + double const currentScale = screen.GetScale(); + if (currentScale > kStartPerspectiveScale) + return 0.0; + return kMaxPerspectiveAngle * (kStartPerspectiveScale - currentScale) / (kStartPerspectiveScale - kMaxScale); +} + } // namespace df |