From 6574f0d1888a9368a6bcd141a24ca34e66367502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Fri, 2 May 2014 10:28:47 +0200 Subject: [PATCH] add setAngle() call with duration --- include/llmr/map/map.hpp | 3 ++- src/map/map.cpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/llmr/map/map.hpp b/include/llmr/map/map.hpp index 906e353df..72e955a93 100644 --- a/include/llmr/map/map.hpp +++ b/include/llmr/map/map.hpp @@ -73,7 +73,8 @@ public: // Rotation void rotateBy(double sx, double sy, double ex, double ey, double duration = 0); - void setAngle(double angle, double cx = -1, double cy = -1); + void setAngle(double angle, double duration = 0); + void setAngle(double angle, double cx, double cy); double getAngle() const; void resetNorth(); void startRotating(); diff --git a/src/map/map.cpp b/src/map/map.cpp index ded52215c..35d845858 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -278,6 +278,11 @@ void Map::rotateBy(double sx, double sy, double ex, double ey, double duration) update(); } +void Map::setAngle(double angle, double duration) { + transform.setAngle(angle, duration * 1_second); + update(); +} + void Map::setAngle(double angle, double cx, double cy) { transform.setAngle(angle, cx, cy); update();