summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-01-10 13:32:02 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-01-10 14:22:44 -0800
commitc9da6e495900cfe927d1f571e1687b20e0543dbd (patch)
treedd56efbfe72191d313110135825b53006696b279 /src
parentcedda5ef4f73fccfc795e6bc48b368e48f11ad8d (diff)
downloadqtlocation-mapboxgl-c9da6e495900cfe927d1f571e1687b20e0543dbd.tar.gz
[core] Account for circle-stroke-width in queryRenderedFeatures
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/renderer/buckets/circle_bucket.cpp3
-rw-r--r--src/mbgl/renderer/layers/render_circle_layer.cpp9
2 files changed, 6 insertions, 6 deletions
diff --git a/src/mbgl/renderer/buckets/circle_bucket.cpp b/src/mbgl/renderer/buckets/circle_bucket.cpp
index d23f0861f4..c442b661de 100644
--- a/src/mbgl/renderer/buckets/circle_bucket.cpp
+++ b/src/mbgl/renderer/buckets/circle_bucket.cpp
@@ -108,8 +108,9 @@ float CircleBucket::getQueryRadius(const RenderLayer& layer) const {
auto circleLayer = layer.as<RenderCircleLayer>();
float radius = get<CircleRadius>(*circleLayer, paintPropertyBinders);
+ float stroke = get<CircleStrokeWidth>(*circleLayer, paintPropertyBinders);
auto translate = circleLayer->evaluated.get<CircleTranslate>();
- return radius + util::length(translate[0], translate[1]);
+ return radius + stroke + util::length(translate[0], translate[1]);
}
} // namespace mbgl
diff --git a/src/mbgl/renderer/layers/render_circle_layer.cpp b/src/mbgl/renderer/layers/render_circle_layer.cpp
index fe2e7cd42d..6092ff5452 100644
--- a/src/mbgl/renderer/layers/render_circle_layer.cpp
+++ b/src/mbgl/renderer/layers/render_circle_layer.cpp
@@ -108,13 +108,12 @@ bool RenderCircleLayer::queryIntersectsFeature(
bearing,
pixelsToTileUnits);
- // Evaluate function
- auto circleRadius = evaluated.get<style::CircleRadius>()
- .evaluate(feature, zoom, style::CircleRadius::defaultValue())
- * pixelsToTileUnits;
+ // Evaluate functions
+ auto radius = evaluated.evaluate<style::CircleRadius>(zoom, feature) * pixelsToTileUnits;
+ auto stroke = evaluated.evaluate<style::CircleStrokeWidth>(zoom, feature) * pixelsToTileUnits;
// Test intersection
- return util::polygonIntersectsBufferedMultiPoint(translatedQueryGeometry.value_or(queryGeometry), feature.getGeometries(), circleRadius);
+ return util::polygonIntersectsBufferedMultiPoint(translatedQueryGeometry.value_or(queryGeometry), feature.getGeometries(), radius + stroke);
}
} // namespace mbgl