summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-08-01 17:28:25 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-08-05 16:13:26 +0300
commit55581b6e61aa0f3bdbcbe4e2a1b8d67a52031aa1 (patch)
tree609b1cb5f2ef1ed2ad49a7b2254fc0226017ae2b
parent9b34997986698f22e1aa0799896591c17d2ac1a3 (diff)
downloadqtlocation-mapboxgl-55581b6e61aa0f3bdbcbe4e2a1b8d67a52031aa1.tar.gz
[core] Remove unused CollisionBox::offset
-rw-r--r--src/mbgl/text/collision_feature.cpp6
-rw-r--r--src/mbgl/text/collision_feature.hpp11
2 files changed, 9 insertions, 8 deletions
diff --git a/src/mbgl/text/collision_feature.cpp b/src/mbgl/text/collision_feature.cpp
index c708f834da..fbf259d1db 100644
--- a/src/mbgl/text/collision_feature.cpp
+++ b/src/mbgl/text/collision_feature.cpp
@@ -54,9 +54,9 @@ CollisionFeature::CollisionFeature(const GeometryCoordinates& line,
const float yMin = std::min({tl.y, tr.y, bl.y, br.y});
const float yMax = std::max({tl.y, tr.y, bl.y, br.y});
- boxes.emplace_back(anchor.point, Point<float>{ 0, 0 }, xMin, yMin, xMax, yMax);
+ boxes.emplace_back(anchor.point, xMin, yMin, xMax, yMax);
} else {
- boxes.emplace_back(anchor.point, Point<float>{ 0, 0 }, x1, y1, x2, y2);
+ boxes.emplace_back(anchor.point, x1, y1, x2, y2);
}
}
}
@@ -155,7 +155,7 @@ void CollisionFeature::bboxifyLabel(const GeometryCoordinates& line, GeometryCoo
0 :
(boxDistanceToAnchor - firstBoxOffset) * 0.8;
- boxes.emplace_back(boxAnchor, boxAnchor - convertPoint<float>(anchorPoint), -boxSize / 2, -boxSize / 2, boxSize / 2, boxSize / 2, paddedAnchorDistance, boxSize / 2);
+ boxes.emplace_back(boxAnchor, -boxSize / 2, -boxSize / 2, boxSize / 2, boxSize / 2, paddedAnchorDistance, boxSize / 2);
}
}
diff --git a/src/mbgl/text/collision_feature.hpp b/src/mbgl/text/collision_feature.hpp
index 5fbd8a5e4b..82a9113caa 100644
--- a/src/mbgl/text/collision_feature.hpp
+++ b/src/mbgl/text/collision_feature.hpp
@@ -11,14 +11,15 @@ namespace mbgl {
class CollisionBox {
public:
- CollisionBox(Point<float> _anchor, Point<float> _offset, float _x1, float _y1, float _x2, float _y2, float _signedDistanceFromAnchor = 0, float _radius = 0) :
- anchor(std::move(_anchor)), offset(_offset), x1(_x1), y1(_y1), x2(_x2), y2(_y2), used(true), signedDistanceFromAnchor(_signedDistanceFromAnchor), radius(_radius) {}
+ CollisionBox(Point<float> _anchor, float _x1, float _y1, float _x2, float _y2, float _signedDistanceFromAnchor = 0, float _radius = 0) :
+ anchor(std::move(_anchor)), x1(_x1), y1(_y1), x2(_x2), y2(_y2), used(true), signedDistanceFromAnchor(_signedDistanceFromAnchor), radius(_radius) {}
// the box is centered around the anchor point
Point<float> anchor;
-
- // the offset of the box from the label's anchor point
- Point<float> offset;
+
+ // the offset of the box from the label's anchor point.
+ // TODO: might be needed for #13526
+ // Point<float> offset;
// distances to the edges from the anchor
float x1;