From cdda9f12b51ca9b2b22bc9f11514c5486a803544 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Tue, 15 Jul 2014 12:52:19 -0700 Subject: [PATCH 1/2] flesh out 'will change region' notifications --- src/map/transform.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/map/transform.cpp b/src/map/transform.cpp index 72449956d..eb9aef69e 100644 --- a/src/map/transform.cpp +++ b/src/map/transform.cpp @@ -57,6 +57,10 @@ void Transform::moveBy(const double dx, const double dy, const timestamp duratio void Transform::_moveBy(const double dx, const double dy, const timestamp duration) { // This is only called internally, so we don't need a lock here. + platform::notify_map_change(duration ? + platform::MapChangeRegionWillChangeAnimated : + platform::MapChangeRegionWillChange); + final.x = current.x + std::cos(current.angle) * dx + std::sin(current.angle) * dy; final.y = current.y + std::cos(current.angle) * dy + std::sin(-current.angle) * dx; @@ -271,6 +275,10 @@ void Transform::_setScaleXY(const double new_scale, const double xn, const doubl const timestamp duration) { // This is only called internally, so we don't need a lock here. + platform::notify_map_change(duration ? + platform::MapChangeRegionWillChangeAnimated : + platform::MapChangeRegionWillChange); + final.scale = new_scale; final.x = xn; final.y = yn; @@ -378,6 +386,10 @@ void Transform::setAngle(const double new_angle, const double cx, const double c void Transform::_setAngle(double new_angle, const timestamp duration) { // This is only called internally, so we don't need a lock here. + platform::notify_map_change(duration ? + platform::MapChangeRegionWillChangeAnimated : + platform::MapChangeRegionWillChange); + while (new_angle > M_PI) new_angle -= M2PI; while (new_angle <= -M_PI) From 5459d80d4723cfed3da8a2088bbb45e1ee3a00ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Tue, 15 Jul 2014 13:31:55 -0700 Subject: [PATCH 2/2] disallow copying to avoid accidental unchecked message output --- test/fixtures/fixture_log.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/fixtures/fixture_log.hpp b/test/fixtures/fixture_log.hpp index 8a4124185..c41d74ab9 100644 --- a/test/fixtures/fixture_log.hpp +++ b/test/fixtures/fixture_log.hpp @@ -2,6 +2,7 @@ #define LLMR_TEST_FIXTURE_LOG #include +#include #include @@ -10,7 +11,7 @@ namespace llmr { -class FixtureLogBackend : public LogBackend { +class FixtureLogBackend : public LogBackend, private util::noncopyable { public: struct LogMessage { inline LogMessage(EventSeverity severity, Event event, int64_t code, const std::string &msg)