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:
authorrachytski <siarhei.rachytski@gmail.com>2011-10-03 21:29:07 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:25:24 +0300
commit9eb5fed75d3178f36db25a1e1b12e7ed007d2b0d (patch)
treec6bcb2e32785e7a67c2dec7d0ed33834d6ef7286
parent5d830d56494790a93533a9498c2d81cfd0632848 (diff)
switched off screen rotation, as it's not so fast as expected to support it in RenderPolicyMT.
-rw-r--r--geometry/screenbase.cpp5
-rw-r--r--map/framework.cpp12
-rw-r--r--map/navigator.cpp18
-rw-r--r--yg/render_state.cpp2
4 files changed, 19 insertions, 18 deletions
diff --git a/geometry/screenbase.cpp b/geometry/screenbase.cpp
index 2f31218c99..2059a4daf6 100644
--- a/geometry/screenbase.cpp
+++ b/geometry/screenbase.cpp
@@ -10,10 +10,11 @@
ScreenBase::ScreenBase() :
m_PixelRect(0, 0, 640, 480),
- m_Scale(1),
+ m_Scale(0.1),
m_Angle(0.0),
m_Org(320, 240),
- m_GlobalRect(m2::RectD(0, 0, 640, 480))
+ m_GlobalRect(m_Org, ang::AngleD(0), m2::RectD(-320, -240, 320, 240)),
+ m_ClipRect(m2::RectD(0, 0, 640, 480))
{
m_GtoP = math::Identity<double, 3>();
m_PtoG = math::Identity<double, 3>();
diff --git a/map/framework.cpp b/map/framework.cpp
index f2579f4543..f8002d08c1 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -534,22 +534,22 @@ void Framework<TModel>::StopDrag(DragEvent const & e)
template <typename TModel>
void Framework<TModel>::StartRotate(RotateEvent const & e)
{
- m_navigator.StartRotate(e.Angle(), m_timer.ElapsedSeconds());
- m_renderPolicy->StartRotate(e.Angle(), m_timer.ElapsedSeconds());
+/* m_navigator.StartRotate(e.Angle(), m_timer.ElapsedSeconds());
+ m_renderPolicy->StartRotate(e.Angle(), m_timer.ElapsedSeconds());*/
}
template <typename TModel>
void Framework<TModel>::DoRotate(RotateEvent const & e)
{
- m_navigator.DoRotate(e.Angle(), m_timer.ElapsedSeconds());
- m_renderPolicy->DoRotate(e.Angle(), m_timer.ElapsedSeconds());
+/* m_navigator.DoRotate(e.Angle(), m_timer.ElapsedSeconds());
+ m_renderPolicy->DoRotate(e.Angle(), m_timer.ElapsedSeconds());*/
}
template <typename TModel>
void Framework<TModel>::StopRotate(RotateEvent const & e)
{
- m_navigator.StopRotate(e.Angle(), m_timer.ElapsedSeconds());
- m_renderPolicy->StopRotate(e.Angle(), m_timer.ElapsedSeconds());
+/* m_navigator.StopRotate(e.Angle(), m_timer.ElapsedSeconds());
+ m_renderPolicy->StopRotate(e.Angle(), m_timer.ElapsedSeconds());*/
}
diff --git a/map/navigator.cpp b/map/navigator.cpp
index 1b2fc63229..52ea4bdc64 100644
--- a/map/navigator.cpp
+++ b/map/navigator.cpp
@@ -96,14 +96,14 @@ void Navigator::OnSize(int x0, int y0, int w, int h)
bool Navigator::CanShrinkInto(ScreenBase const & screen, m2::RectD const & boundRect)
{
- m2::RectD globalRect = screen.GlobalRect();
+ m2::RectD globalRect = screen.ClipRect();
return (boundRect.SizeX() >= globalRect.SizeX()) && (boundRect.SizeY() >= globalRect.SizeY());
}
ScreenBase const Navigator::ShrinkInto(ScreenBase const & screen, m2::RectD const & boundRect)
{
ScreenBase res = screen;
- m2::RectD globalRect = res.GlobalRect();
+ m2::RectD globalRect = res.ClipRect();
if (globalRect.minX() < boundRect.minX())
globalRect.Offset(boundRect.minX() - globalRect.minX(), 0);
if (globalRect.maxX() > boundRect.maxX())
@@ -112,14 +112,14 @@ ScreenBase const Navigator::ShrinkInto(ScreenBase const & screen, m2::RectD cons
globalRect.Offset(0, boundRect.minY() - globalRect.minY());
if (globalRect.maxY() > boundRect.maxY())
globalRect.Offset(0, boundRect.maxY() - globalRect.maxY());
- res.SetFromRect(globalRect);
+ res.SetFromRect(m2::AnyRectD(globalRect));
return res;
}
ScreenBase const Navigator::ScaleInto(ScreenBase const & screen, m2::RectD const & boundRect)
{
ScreenBase res = screen;
- m2::RectD globalRect = res.GlobalRect();
+ m2::RectD globalRect = res.ClipRect();
if (globalRect.minX() < boundRect.minX())
globalRect.Scale((boundRect.minX() - globalRect.Center().x) / (globalRect.minX() - globalRect.Center().x));
@@ -130,14 +130,14 @@ ScreenBase const Navigator::ScaleInto(ScreenBase const & screen, m2::RectD const
if (globalRect.maxY() > boundRect.maxY())
globalRect.Scale((boundRect.maxY() - globalRect.Center().y) / (globalRect.maxY() - globalRect.Center().y));
- res.SetFromRect(globalRect);
+ res.SetFromRect(m2::AnyRectD(globalRect));
return res;
}
ScreenBase const Navigator::ShrinkAndScaleInto(ScreenBase const & screen, m2::RectD const & boundRect)
{
ScreenBase res = screen;
- m2::RectD globalRect = res.GlobalRect();
+ m2::RectD globalRect = res.ClipRect();
if (globalRect.minX() < boundRect.minX())
{
@@ -167,7 +167,7 @@ ScreenBase const Navigator::ShrinkAndScaleInto(ScreenBase const & screen, m2::Re
globalRect.Scale((globalRect.Center().y - boundRect.minY()) / (globalRect.Center().y - globalRect.minY()));
}
- res.SetFromRect(globalRect);
+ res.SetFromRect(m2::AnyRectD(globalRect));
return res;
}
@@ -319,7 +319,7 @@ bool Navigator::CheckMinScale(ScreenBase const & screen)
bool Navigator::CheckBorders(ScreenBase const & screen)
{
- m2::RectD ScreenBounds = screen.GlobalRect();
+ m2::RectD ScreenBounds = screen.ClipRect();
return ScreenBounds.IsRectInside(m_worldRect) || m_worldRect.IsRectInside(ScreenBounds);
}
@@ -331,7 +331,7 @@ bool Navigator::ScaleImpl(m2::PointD const & newPt1, m2::PointD const & newPt2,
ScreenBase tmp = m_Screen;
tmp.SetGtoPMatrix(newM);
- //tmp.Rotate(tmp.GetAngle());
+// tmp.Rotate(-tmp.GetAngle());
if (!skipMaxScaleAndBordersCheck && !CheckMaxScale(tmp))
return false;
diff --git a/yg/render_state.cpp b/yg/render_state.cpp
index 10b4301774..e8e24fae46 100644
--- a/yg/render_state.cpp
+++ b/yg/render_state.cpp
@@ -22,7 +22,7 @@ namespace yg
bool RenderState::isPanning() const
{
- return IsPanning(m_actualScreen, m_currentScreen);
+ return IsPanningAndRotate(m_actualScreen, m_currentScreen);
}
void RenderState::copyTo(RenderState &s) const