From adfac6f0615b7f79da2c80d0580428a92e9f0089 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Tue, 17 Nov 2015 17:19:54 +0200 Subject: [core] Added ConstrainMode::{HeightOnly,WidthAndHeight} ConstrainMode gives flexibility to our engine to choose between constraining both vertically and horizontally, or just vertically (default behavior). Constrain in both axis means we can no longer pan the map beyond the map boundaries. This fixes an issue where e.g. annotations disappear upon crossing the map boundaries. --- include/mbgl/map/map.hpp | 3 ++- include/mbgl/map/mode.hpp | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'include/mbgl/map') diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index f2e605141b..c190088088 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -45,7 +45,8 @@ class Map : private util::noncopyable { public: explicit Map(View&, FileSource&, MapMode mapMode = MapMode::Continuous, - GLContextMode contextMode = GLContextMode::Unique); + GLContextMode contextMode = GLContextMode::Unique, + ConstrainMode constrainMode = ConstrainMode::HeightOnly); ~Map(); // Pauses the render thread. The render thread will stop running but will not be terminated and will not lose state until resumed. diff --git a/include/mbgl/map/mode.hpp b/include/mbgl/map/mode.hpp index 6ad9af5c74..8b65baf99f 100644 --- a/include/mbgl/map/mode.hpp +++ b/include/mbgl/map/mode.hpp @@ -19,6 +19,13 @@ enum class GLContextMode : uint8_t { Shared, }; +// We can choose to constrain the map both horizontally or vertically, or only +// vertically e.g. while panning. +enum class ConstrainMode : uint8_t { + HeightOnly, + WidthAndHeight, +}; + } // namespace mbgl #endif // MBGL_MAP_MODE -- cgit v1.2.1