summaryrefslogtreecommitdiff
path: root/src/mbgl/geometry/anchor.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/geometry/anchor.hpp')
-rw-r--r--src/mbgl/geometry/anchor.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mbgl/geometry/anchor.hpp b/src/mbgl/geometry/anchor.hpp
index b24d8d04e0..1a2cbd3dac 100644
--- a/src/mbgl/geometry/anchor.hpp
+++ b/src/mbgl/geometry/anchor.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <mbgl/util/geometry.hpp>
+#include <mbgl/util/optional.hpp>
#include <vector>
@@ -11,9 +12,9 @@ public:
Point<float> point;
float angle = 0.0f;
float scale = 0.0f;
- int segment = -1;
+ optional<std::size_t> segment;
- Anchor(float x_, float y_, float angle_, float scale_, int segment_ = -1)
+ Anchor(float x_, float y_, float angle_, float scale_, optional<std::size_t> segment_ = nullopt)
: point(x_, y_), angle(angle_), scale(scale_), segment(segment_) {}
};