diff options
author | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2016-07-07 18:46:19 +0300 |
---|---|---|
committer | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2016-07-08 17:24:54 +0300 |
commit | 6c6ff08f9dd685135cff652c966cabb9dcf99879 (patch) | |
tree | a5d891af03dc375db040f4e75b8d7de91c30974a /geometry/screenbase.cpp | |
parent | 7ab8f049ed68092129f96de13940afab01adfbf6 (diff) |
Review fixes.
Diffstat (limited to 'geometry/screenbase.cpp')
-rw-r--r-- | geometry/screenbase.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/geometry/screenbase.cpp b/geometry/screenbase.cpp index 1c4503ac5c..89455ae424 100644 --- a/geometry/screenbase.cpp +++ b/geometry/screenbase.cpp @@ -94,11 +94,8 @@ void ScreenBase::UpdateDependentParameters() } } -double ScreenBase::CalculatePerspectiveAngle(double scale) const +double ScreenBase::CalculateAutoPerspectiveAngle(double scale) { - if (!m_isAutoPerspective) - return m_3dAngleX; - if (scale > kStartPerspectiveScale1) return 0.0; @@ -117,6 +114,14 @@ double ScreenBase::CalculatePerspectiveAngle(double scale) const return kMaxPerspectiveAngle2 * 0.99; } +double ScreenBase::CalculatePerspectiveAngle(double scale) const +{ + if (!m_isAutoPerspective) + return m_3dAngleX; + + return CalculateAutoPerspectiveAngle(scale); +} + void ScreenBase::SetAutoPerspective(bool isAutoPerspective) { m_isAutoPerspective = isAutoPerspective; @@ -421,10 +426,12 @@ void ScreenBase::ResetPerspective() m_isPerspective = false; m_isAutoPerspective = false; + double const old_dy = m_ViewportRect.SizeY() * (m_3dScale - 1.0); + + m_3dScale = 1.0; m_3dAngleX = 0.0; m_3dMaxAngleX = 0.0; - double const old_dy = m_ViewportRect.SizeY() * (m_3dScale - 1.0); Move(0.0, -old_dy / 2.0); } |