Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaria Volvenkova <d.volvenkova@corp.mail.ru>2016-06-20 20:04:01 +0300
committerDaria Volvenkova <d.volvenkova@corp.mail.ru>2016-07-07 15:31:09 +0300
commit74e5ac5cb9a8a5ba0b0aa9d84dfb17d410610373 (patch)
tree00e40eff579b8e4101d124131f4c6ed25ca79c09 /geometry
parent500c4a0e51272e651c01a23d5f016d3bdf4b23c5 (diff)
GUI rendering fixed in perspective mode.
Diffstat (limited to 'geometry')
-rw-r--r--geometry/screenbase.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/geometry/screenbase.cpp b/geometry/screenbase.cpp
index fb462fe11c..01e55db869 100644
--- a/geometry/screenbase.cpp
+++ b/geometry/screenbase.cpp
@@ -378,17 +378,17 @@ void ScreenBase::ApplyPerspective(double currentRotationAngle, double maxRotatio
ASSERT_GREATER_OR_EQUAL(maxRotationAngle, 0.0, ());
ASSERT_LESS(maxRotationAngle, math::pi2, ());
-// if (m_isPerspective)
-// ResetPerspective();
-
m_isPerspective = true;
+ m_isAutoPerspective = false;
m_3dMaxAngleX = maxRotationAngle;
+ m_3dAngleX = currentRotationAngle;
m_3dFOV = angleFOV;
double const old_dy = m_ViewportRect.SizeY() * (m_3dScale - 1.0);
+
m_3dScale = CalculateScale3d(m_3dMaxAngleX);
- double const new_dy = m_ViewportRect.SizeY() * (CalculateScale3d(m_3dMaxAngleX) - 1.0);
+ double const new_dy = m_ViewportRect.SizeY() * (m_3dScale - 1.0);
SetRotationAngle(currentRotationAngle);
@@ -444,18 +444,13 @@ void ScreenBase::SetRotationAngle(double rotationAngle)
void ScreenBase::ResetPerspective()
{
m_isPerspective = false;
+ m_isAutoPerspective = false;
- double const dy = m_PixelRect.SizeY() * (1.0 - 1.0 / m_3dScale);
-
- m_PixelRect.setMaxX(m_PixelRect.maxX() / m_3dScale);
- m_PixelRect.setMaxY(m_PixelRect.maxY() / m_3dScale);
-
- Move(0, -dy / 2.0);
-
- m_3dScale = 1.0;
m_3dAngleX = 0.0;
m_3dMaxAngleX = 0.0;
- m_3dFOV = 0.0;
+
+ double const old_dy = m_ViewportRect.SizeY() * (m_3dScale - 1.0);
+ Move(0.0, -old_dy / 2.0);
}
m2::PointD ScreenBase::PtoP3d(m2::PointD const & pt) const