diff options
author | zmiao <zmiao.jamie@gmail.com> | 2019-08-28 14:18:24 +0300 |
---|---|---|
committer | zmiao <zmiao.jamie@gmail.com> | 2019-08-28 14:18:24 +0300 |
commit | 504c4b1296cec20f589398db3d85d68e5dbb0204 (patch) | |
tree | 598827eb3e8a5ae126aa114726c207c82cca8578 | |
parent | 0aa5faa9c69541dc414eedccd52075411c978680 (diff) | |
download | qtlocation-mapboxgl-504c4b1296cec20f589398db3d85d68e5dbb0204.tar.gz |
Add changelog
-rw-r--r-- | platform/android/CHANGELOG.md | 3 | ||||
-rw-r--r-- | platform/ios/CHANGELOG.md | 1 | ||||
-rw-r--r-- | platform/macos/CHANGELOG.md | 1 | ||||
-rw-r--r-- | platform/node/CHANGELOG.md | 1 | ||||
-rw-r--r-- | src/mbgl/layout/symbol_layout.cpp | 11 | ||||
-rw-r--r-- | src/mbgl/renderer/buckets/symbol_bucket.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/renderer/layers/render_symbol_layer.cpp | 14 | ||||
-rw-r--r-- | src/mbgl/text/placement.cpp | 4 |
8 files changed, 24 insertions, 17 deletions
diff --git a/platform/android/CHANGELOG.md b/platform/android/CHANGELOG.md index 61ff97e10e..dcf8507ee6 100644 --- a/platform/android/CHANGELOG.md +++ b/platform/android/CHANGELOG.md @@ -6,6 +6,9 @@ Mapbox welcomes participation and contributions from everyone. If you'd like to ### Features - Introduce `clusterProperties` option for aggregated cluster properties. [#15425](https://github.com/mapbox/mapbox-gl-native/pull/15425) +### Bug fixes + - Fixed a rendering issue of `collisionBox` when `text-translate` or `icon-translate` is enabled. [#15467](https://github.com/mapbox/mapbox-gl-native/pull/15467) + ## 8.3.0 - August 28, 2019 [Changes](https://github.com/mapbox/mapbox-gl-native/compare/android-v8.3.0-beta.1...android-v8.3.0) since [Mapbox Maps SDK for Android v8.3.0-beta.1](https://github.com/mapbox/mapbox-gl-native/releases/tag/android-v8.3.0-beta.1): diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 24e6330286..be2fb320e9 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -7,6 +7,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Fixed an issue that caused the tilt gesture to trigger too easily and conflict with pinch or pan gestures. ([#15349](https://github.com/mapbox/mapbox-gl-native/pull/15349)) * Fixed a bug with annotation view positions after camera transitions. ([#15122](https://github.com/mapbox/mapbox-gl-native/pull/15122/)) * Fixed a rendering issue that non-SDF icon would be treated as SDF icon if they are in the same layer. ([#15456](https://github.com/mapbox/mapbox-gl-native/pull/15456)) +* Fixed a rendering issue of `collisionBox` when `text-translate` or `icon-translate` is enabled. ([#15467](https://github.com/mapbox/mapbox-gl-native/pull/15467)) ## 5.3.0 diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index 076bc64a6e..bd1a84a495 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -14,6 +14,7 @@ * Fixed rendering and collision detection issues with using `text-variable-anchor` and `icon-text-fit` properties on the same layer. ([#15367](https://github.com/mapbox/mapbox-gl-native/pull/15367)) * Fixed symbol overlap when zooming out quickly. ([15416](https://github.com/mapbox/mapbox-gl-native/pull/15416)) * Fixed a rendering issue that non-SDF icon would be treated as SDF icon if they are in the same layer. ([#15456](https://github.com/mapbox/mapbox-gl-native/pull/15456)) +* Fixed a rendering issue of `collisionBox` when `text-translate` or `icon-translate` is enabled. ([#15467](https://github.com/mapbox/mapbox-gl-native/pull/15467)) ### Styles and rendering diff --git a/platform/node/CHANGELOG.md b/platform/node/CHANGELOG.md index 9338409b3e..43b18208b4 100644 --- a/platform/node/CHANGELOG.md +++ b/platform/node/CHANGELOG.md @@ -2,6 +2,7 @@ * Introduce `text-writing-mode` layout property for symbol layer ([#14932](https://github.com/mapbox/mapbox-gl-native/pull/14932)). The `text-writing-mode` layout property allows control over symbol's preferred writing mode. The new property value is an array, whose values are enumeration values from a ( `horizontal` | `vertical` ) set. * Fixed rendering and collision detection issues with using `text-variable-anchor` and `icon-text-fit` properties on the same layer ([#15367](https://github.com/mapbox/mapbox-gl-native/pull/15367)). * Fixed a rendering issue that non-SDF icon would be treated as SDF icon if they are in the same layer. ([#15456](https://github.com/mapbox/mapbox-gl-native/pull/15456)) +* Fixed a rendering issue of `collisionBox` when `text-translate` or `icon-translate` is enabled. ([#15467](https://github.com/mapbox/mapbox-gl-native/pull/15467)) # 4.2.0 - Add an option to set whether or not an image should be treated as a SDF ([#15054](https://github.com/mapbox/mapbox-gl-native/issues/15054)) diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp index 3de7735ad1..f750113e55 100644 --- a/src/mbgl/layout/symbol_layout.cpp +++ b/src/mbgl/layout/symbol_layout.cpp @@ -807,10 +807,11 @@ size_t SymbolLayout::addSymbol(SymbolBucket::Buffer& buffer, } void SymbolLayout::addToDebugBuffers(SymbolBucket& bucket) { + if (!hasSymbolInstances()) { return; } - + for (const SymbolInstance& symbolInstance : symbolInstances) { auto populateCollisionBox = [&](const auto& feature, bool isText) { SymbolBucket::CollisionBuffer& collisionBuffer = @@ -822,10 +823,10 @@ void SymbolLayout::addToDebugBuffers(SymbolBucket& bucket) { for (const CollisionBox& box : feature.boxes) { auto& anchor = box.anchor; - Point<float> tl{ box.x1, box.y1 }; - Point<float> tr{ box.x2, box.y1 }; - Point<float> bl{ box.x1, box.y2 }; - Point<float> br{ box.x2, box.y2 }; + Point<float> tl{box.x1, box.y1}; + Point<float> tr{box.x2, box.y1}; + Point<float> bl{box.x1, box.y2}; + Point<float> br{box.x2, box.y2}; static constexpr std::size_t vertexLength = 4; const std::size_t indexLength = feature.alongLine ? 6 : 8; diff --git a/src/mbgl/renderer/buckets/symbol_bucket.cpp b/src/mbgl/renderer/buckets/symbol_bucket.cpp index 72149a5120..ff201e9c2c 100644 --- a/src/mbgl/renderer/buckets/symbol_bucket.cpp +++ b/src/mbgl/renderer/buckets/symbol_bucket.cpp @@ -182,7 +182,7 @@ bool SymbolBucket::hasIconData() const { bool SymbolBucket::hasSdfIconData() const { return !sdfIcon.segments.empty(); } - + bool SymbolBucket::hasIconCollisionBoxData() const { return iconCollisionBox && !iconCollisionBox->segments.empty(); } @@ -190,7 +190,7 @@ bool SymbolBucket::hasIconCollisionBoxData() const { bool SymbolBucket::hasIconCollisionCircleData() const { return iconCollisionCircle && !iconCollisionCircle->segments.empty(); } - + bool SymbolBucket::hasTextCollisionBoxData() const { return textCollisionBox && !textCollisionBox->segments.empty(); } @@ -198,7 +198,7 @@ bool SymbolBucket::hasTextCollisionBoxData() const { bool SymbolBucket::hasTextCollisionCircleData() const { return textCollisionCircle && !textCollisionCircle->segments.empty(); } - + void addPlacedSymbol(gfx::IndexVector<gfx::Triangles>& triangles, const PlacedSymbol& placedSymbol) { auto endIndex = placedSymbol.vertexStartIndex + placedSymbol.glyphOffsets.size() * 4; for (auto vertexIndex = placedSymbol.vertexStartIndex; vertexIndex < endIndex; vertexIndex += 4) { diff --git a/src/mbgl/renderer/layers/render_symbol_layer.cpp b/src/mbgl/renderer/layers/render_symbol_layer.cpp index 4c4d7fb5de..06eacc041b 100644 --- a/src/mbgl/renderer/layers/render_symbol_layer.cpp +++ b/src/mbgl/renderer/layers/render_symbol_layer.cpp @@ -399,10 +399,11 @@ void RenderSymbolLayer::render(PaintParameters& parameters) { static const CollisionBoxProgram::Binders paintAttributeData(properties, 0); auto pixelRatio = tile.id.pixelsToTileUnits(1, parameters.state.getZoom()); const float scale = std::pow(2, parameters.state.getZoom() - tile.getOverscaledTileID().overscaledZ); - std::array<float, 2> extrudeScale = { - { parameters.pixelsToGLUnits[0] / (pixelRatio * scale), - parameters.pixelsToGLUnits[1] / (pixelRatio * scale) } - }; + std::array<float,2> extrudeScale = + {{ + parameters.pixelsToGLUnits[0] / (pixelRatio * scale), + parameters.pixelsToGLUnits[1] / (pixelRatio * scale) + }}; const auto& evaluated = getEvaluated<SymbolLayerProperties>(renderData->layerProperties); const auto& layout = *bucket.layout; const auto values = isText ? textPropertyValues(evaluated, layout): iconPropertyValues(evaluated, layout); @@ -446,8 +447,7 @@ void RenderSymbolLayer::render(PaintParameters& parameters) { parameters.colorModeForRenderPass(), gfx::CullFaceMode::disabled(), CollisionCircleProgram::LayoutUniformValues { - uniforms::matrix::Value( - (needTranslate + uniforms::matrix::Value((needTranslate ? tile.translatedMatrix(values.translate, values.translateAnchor, parameters.state) : tile.matrix)), uniforms::extrude_scale::Value(extrudeScale), @@ -456,7 +456,7 @@ void RenderSymbolLayer::render(PaintParameters& parameters) { }, *collisionCircle->vertexBuffer, *collisionCircle->dynamicVertexBuffer, - *collisionCircle->indexBuffer, + *collisionCircle->indexBuffer, collisionCircle->segments, paintAttributeData, properties, diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp index f5ca23dc7a..4cf69a11b6 100644 --- a/src/mbgl/text/placement.cpp +++ b/src/mbgl/text/placement.cpp @@ -419,7 +419,7 @@ void Placement::placeBucket( const bool hasIconCollisionCircleData = bucket.hasIconCollisionCircleData(); const bool hasTextCollisionCircleData = bucket.hasTextCollisionCircleData(); - + if (hasIconCollisionCircleData && symbolInstance.iconCollisionFeature.alongLine && !iconBoxes.empty()) { collisionCircles[&symbolInstance.iconCollisionFeature] = iconBoxes; } @@ -864,7 +864,7 @@ void Placement::updateBucketOpacities(SymbolBucket& bucket, const TransformState updateIconCollisionBox(*symbolInstance.verticalIconCollisionFeature, opacityState.text.placed, hasIconTextFit ? verticalTextShift : Point<float>{0.0f, 0.0f}); } } - + if (bucket.hasIconCollisionCircleData()) { updateCollisionCircles(symbolInstance.iconCollisionFeature, opacityState.icon.placed, false); } |