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>2012-10-19 17:34:22 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:45:55 +0300
commit5080d7ccfe10ffdd68575e4642be37b7838def2d (patch)
treea0e834d2346bacf350c64195b7f45e0cd03999b7 /map/animator.cpp
parent877f0234a4f6e5ef727b93e5ab8f11ec219740c5 (diff)
fixed flickering during animation and two-fingers scaling.
Diffstat (limited to 'map/animator.cpp')
-rw-r--r--map/animator.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/map/animator.cpp b/map/animator.cpp
index 2568fe0b8c..ad38102765 100644
--- a/map/animator.cpp
+++ b/map/animator.cpp
@@ -1,6 +1,7 @@
#include "animator.hpp"
#include "rotate_screen_task.hpp"
#include "change_viewport_task.hpp"
+#include "move_screen_task.hpp"
#include "framework.hpp"
#include "../anim/controller.hpp"
@@ -67,6 +68,43 @@ void Animator::StopRotation()
m_rotateScreenTask.reset();
}
+shared_ptr<MoveScreenTask> const & Animator::MoveScreen(m2::PointD const & startPt,
+ m2::PointD const & endPt,
+ double speed)
+{
+ StopMoveScreen();
+
+ m_moveScreenTask.reset(new MoveScreenTask(m_framework,
+ startPt,
+ endPt,
+ speed));
+
+ m_framework->GetAnimController()->AddTask(m_moveScreenTask);
+
+ return m_moveScreenTask;
+}
+
+void Animator::StopMoveScreen()
+{
+ if (m_moveScreenTask)
+ m_moveScreenTask->Lock();
+
+ if (m_moveScreenTask
+ && !m_moveScreenTask->IsEnded()
+ && !m_moveScreenTask->IsCancelled())
+ {
+ m_moveScreenTask->Cancel();
+ m_moveScreenTask->Unlock();
+ m_moveScreenTask.reset();
+ return;
+ }
+
+ if (m_moveScreenTask)
+ m_moveScreenTask->Unlock();
+
+ m_moveScreenTask.reset();
+}
+
shared_ptr<ChangeViewportTask> const & Animator::ChangeViewport(m2::AnyRectD const & start,
m2::AnyRectD const & end,
double rotationSpeed)