From d579cec9656c32ab89567fc51fb30afdd2aa5721 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 12 Mar 2015 15:58:48 -0400 Subject: [PATCH] Rename some style properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit symbol-min-distance ⇢ symbol-spacing background-image ⇢ background-pattern line-image ⇢ line-pattern fill-image ⇢ fill-pattern --- src/mbgl/map/tile_worker.cpp | 2 +- src/mbgl/renderer/symbol_bucket.cpp | 2 +- src/mbgl/style/property_fallback.cpp | 2 +- src/mbgl/style/property_key.hpp | 2 +- src/mbgl/style/style_layout.hpp | 2 +- src/mbgl/style/style_parser.cpp | 8 ++++---- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/mbgl/map/tile_worker.cpp b/src/mbgl/map/tile_worker.cpp index dd56f33f51f..77dc5c22fa7 100644 --- a/src/mbgl/map/tile_worker.cpp +++ b/src/mbgl/map/tile_worker.cpp @@ -215,7 +215,7 @@ std::unique_ptr TileWorker::createSymbolBucket(const GeometryTileLayer& layout.icon.rotation_alignment = RotationAlignmentType::Map; layout.text.rotation_alignment = RotationAlignmentType::Map; }; - applyLayoutProperty(PropertyKey::SymbolMinDistance, bucket_desc.layout, layout.min_distance, z); + applyLayoutProperty(PropertyKey::SymbolSpacing, bucket_desc.layout, layout.spacing, z); applyLayoutProperty(PropertyKey::SymbolAvoidEdges, bucket_desc.layout, layout.avoid_edges, z); applyLayoutProperty(PropertyKey::IconAllowOverlap, bucket_desc.layout, layout.icon.allow_overlap, z); diff --git a/src/mbgl/renderer/symbol_bucket.cpp b/src/mbgl/renderer/symbol_bucket.cpp index 1ee90293d27..71f4dc3d381 100644 --- a/src/mbgl/renderer/symbol_bucket.cpp +++ b/src/mbgl/renderer/symbol_bucket.cpp @@ -277,7 +277,7 @@ void SymbolBucket::addFeature(const std::vector> &lines, const float fontScale = layout.text.max_size / glyphSize; const float textBoxScale = collision.tilePixelRatio * fontScale; const float iconBoxScale = collision.tilePixelRatio * layout.icon.max_size; - const float symbolSpacing = collision.tilePixelRatio * layout.min_distance; + const float symbolSpacing = collision.tilePixelRatio * layout.spacing; const bool avoidEdges = layout.avoid_edges && layout.placement != PlacementType::Line; const float textPadding = layout.text.padding * collision.tilePixelRatio; const float iconPadding = layout.icon.padding * collision.tilePixelRatio; diff --git a/src/mbgl/style/property_fallback.cpp b/src/mbgl/style/property_fallback.cpp index 655a75df9b6..091c12e5d85 100644 --- a/src/mbgl/style/property_fallback.cpp +++ b/src/mbgl/style/property_fallback.cpp @@ -56,7 +56,7 @@ const std::map PropertyFallbackValue::properties = { { PropertyKey::LineRoundLimit, defaultStyleLayout().round_limit }, { PropertyKey::SymbolPlacement, defaultStyleLayout().placement }, - { PropertyKey::SymbolMinDistance, defaultStyleLayout().min_distance }, + { PropertyKey::SymbolSpacing, defaultStyleLayout().spacing }, { PropertyKey::SymbolAvoidEdges, defaultStyleLayout().avoid_edges }, { PropertyKey::IconAllowOverlap, defaultStyleLayout().icon.allow_overlap }, diff --git a/src/mbgl/style/property_key.hpp b/src/mbgl/style/property_key.hpp index dfe82e4bb0b..015ea1aa630 100644 --- a/src/mbgl/style/property_key.hpp +++ b/src/mbgl/style/property_key.hpp @@ -28,7 +28,7 @@ enum class PropertyKey { LineRoundLimit, SymbolPlacement, - SymbolMinDistance, + SymbolSpacing, SymbolAvoidEdges, IconOpacity, diff --git a/src/mbgl/style/style_layout.hpp b/src/mbgl/style/style_layout.hpp index 90bc71fd6eb..5561a6777d2 100644 --- a/src/mbgl/style/style_layout.hpp +++ b/src/mbgl/style/style_layout.hpp @@ -42,7 +42,7 @@ class StyleLayoutSymbol { StyleLayoutSymbol& operator=(const StyleLayoutSymbol &) = delete; PlacementType placement = PlacementType::Point; - float min_distance = 250.0f; + float spacing = 250.0f; bool avoid_edges = false; struct { diff --git a/src/mbgl/style/style_parser.cpp b/src/mbgl/style/style_parser.cpp index 933587862e5..b9ba61ee229 100644 --- a/src/mbgl/style/style_parser.cpp +++ b/src/mbgl/style/style_parser.cpp @@ -816,7 +816,7 @@ void StyleParser::parsePaint(JSVal value, ClassProperties &klass) { parseOptionalProperty>>("fill-translate", Key::FillTranslate, klass, value); parseOptionalProperty("fill-translate-transition", Key::FillTranslate, klass, value); parseOptionalProperty>("fill-translate-anchor", Key::FillTranslateAnchor, klass, value); - parseOptionalProperty>>("fill-image", Key::FillImage, klass, value, "fill-image-transition"); + parseOptionalProperty>>("fill-pattern", Key::FillImage, klass, value, "fill-pattern-transition"); parseOptionalProperty>("line-opacity", Key::LineOpacity, klass, value); parseOptionalProperty("line-opacity-transition", Key::LineOpacity, klass, value); @@ -832,7 +832,7 @@ void StyleParser::parsePaint(JSVal value, ClassProperties &klass) { parseOptionalProperty>("line-blur", Key::LineBlur, klass, value); parseOptionalProperty("line-blur-transition", Key::LineBlur, klass, value); parseOptionalProperty>>>("line-dasharray", Key::LineDashArray, klass, value, "line-dasharray-transition"); - parseOptionalProperty>>("line-image", Key::LineImage, klass, value, "line-image-transition"); + parseOptionalProperty>>("line-pattern", Key::LineImage, klass, value, "line-pattern-transition"); parseOptionalProperty>("icon-opacity", Key::IconOpacity, klass, value); parseOptionalProperty("icon-opacity-transition", Key::IconOpacity, klass, value); @@ -882,7 +882,7 @@ void StyleParser::parsePaint(JSVal value, ClassProperties &klass) { parseOptionalProperty>("background-opacity", Key::BackgroundOpacity, klass, value); parseOptionalProperty>("background-color", Key::BackgroundColor, klass, value); - parseOptionalProperty>>("background-image", Key::BackgroundImage, klass, value, "background-image-transition"); + parseOptionalProperty>>("background-pattern", Key::BackgroundImage, klass, value, "background-pattern-transition"); } void StyleParser::parseLayout(JSVal value, util::ptr &bucket) { @@ -896,7 +896,7 @@ void StyleParser::parseLayout(JSVal value, util::ptr &bucket) { parseOptionalProperty>("line-round-limit", Key::LineRoundLimit, bucket->layout, value); parseOptionalProperty>("symbol-placement", Key::SymbolPlacement, bucket->layout, value); - parseOptionalProperty>("symbol-min-distance", Key::SymbolMinDistance, bucket->layout, value); + parseOptionalProperty>("symbol-spacing", Key::SymbolSpacing, bucket->layout, value); parseOptionalProperty>("symbol-avoid-edges", Key::SymbolAvoidEdges, bucket->layout, value); parseOptionalProperty>("icon-allow-overlap", Key::IconAllowOverlap, bucket->layout, value); parseOptionalProperty>("icon-ignore-placement", Key::IconIgnorePlacement, bucket->layout, value);