summaryrefslogtreecommitdiff
path: root/src/mbgl/text/collision_feature.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-05-11 14:03:07 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-05-12 08:36:30 -0700
commitb87fe1616991e1dc454c9bfc74ec68caff0b7062 (patch)
tree5228310960c1a978625c3b1d235bcfc4c909dc42 /src/mbgl/text/collision_feature.hpp
parent00a86ba03f8a6bc4ceff62ef984c020733bf0945 (diff)
downloadqtlocation-mapboxgl-b87fe1616991e1dc454c9bfc74ec68caff0b7062.tar.gz
[core] CollisionBox::indexedFeature to CollisionFeature::indexedFeature
This eliminates the CollisionBox constructor that instantiates an "empty" IndexedSubfeature.
Diffstat (limited to 'src/mbgl/text/collision_feature.hpp')
-rw-r--r--src/mbgl/text/collision_feature.hpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/mbgl/text/collision_feature.hpp b/src/mbgl/text/collision_feature.hpp
index 0fe248a3de..840b37b943 100644
--- a/src/mbgl/text/collision_feature.hpp
+++ b/src/mbgl/text/collision_feature.hpp
@@ -11,9 +11,8 @@
namespace mbgl {
class CollisionBox {
public:
- explicit CollisionBox(const Point<float> &_anchor, float _x1, float _y1, float _x2, float _y2, float _maxScale,
- const IndexedSubfeature& indexedFeature_ = { 0, "", "", 0 }) :
- anchor(_anchor), x1(_x1), y1(_y1), x2(_x2), y2(_y2), maxScale(_maxScale), indexedFeature(indexedFeature_) {}
+ explicit CollisionBox(const Point<float> &_anchor, float _x1, float _y1, float _x2, float _y2, float _maxScale) :
+ anchor(_anchor), x1(_x1), y1(_y1), x2(_x2), y2(_y2), maxScale(_maxScale) {}
// the box is centered around the anchor point
Point<float> anchor;
@@ -30,8 +29,6 @@ namespace mbgl {
// the scale at which the label can first be shown
float placementScale = 0.0f;
-
- IndexedSubfeature indexedFeature;
};
class CollisionFeature {
@@ -39,18 +36,18 @@ namespace mbgl {
// for text
inline explicit CollisionFeature(const GeometryCoordinates &line, const Anchor &anchor,
const Shaping &shapedText,
- const float boxScale, const float padding, const bool alongLine, const IndexedSubfeature& indexedFeature)
+ const float boxScale, const float padding, const bool alongLine, const IndexedSubfeature& indexedFeature_)
: CollisionFeature(line, anchor,
shapedText.top, shapedText.bottom, shapedText.left, shapedText.right,
- boxScale, padding, alongLine, indexedFeature, false) {}
+ boxScale, padding, alongLine, indexedFeature_, false) {}
// for icons
inline explicit CollisionFeature(const GeometryCoordinates &line, const Anchor &anchor,
const PositionedIcon &shapedIcon,
- const float boxScale, const float padding, const bool alongLine, const IndexedSubfeature& indexedFeature)
+ const float boxScale, const float padding, const bool alongLine, const IndexedSubfeature& indexedFeature_)
: CollisionFeature(line, anchor,
shapedIcon.top, shapedIcon.bottom, shapedIcon.left, shapedIcon.right,
- boxScale, padding, alongLine, indexedFeature, true) {}
+ boxScale, padding, alongLine, indexedFeature_, true) {}
explicit CollisionFeature(const GeometryCoordinates &line, const Anchor &anchor,
const float top, const float bottom, const float left, const float right,
@@ -59,11 +56,11 @@ namespace mbgl {
std::vector<CollisionBox> boxes;
+ IndexedSubfeature indexedFeature;
private:
void bboxifyLabel(const GeometryCoordinates &line, GeometryCoordinate &anchorPoint,
- const int segment, const float length, const float height,
- const IndexedSubfeature&);
+ const int segment, const float length, const float height);
};
} // namespace mbgl