summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-04-19 10:16:21 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-04-21 14:05:40 -0700
commit2ea450205d8b89db28f7160365b73d26bf4b8812 (patch)
tree6ce2c8116e4c4f66c9b80e23dbb46000a0914fbd /src
parent2df1c36ab82af663c6f612da2ffda1fdc13531c2 (diff)
downloadqtlocation-mapboxgl-2ea450205d8b89db28f7160365b73d26bf4b8812.tar.gz
[core] PlacementType ⇢ SymbolPlacementType
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/layer/symbol_layer.cpp2
-rw-r--r--src/mbgl/layer/symbol_layer.hpp2
-rw-r--r--src/mbgl/renderer/symbol_bucket.cpp16
-rw-r--r--src/mbgl/style/function.cpp4
-rw-r--r--src/mbgl/style/property_parsing.cpp8
-rw-r--r--src/mbgl/util/interpolate.hpp2
6 files changed, 17 insertions, 17 deletions
diff --git a/src/mbgl/layer/symbol_layer.cpp b/src/mbgl/layer/symbol_layer.cpp
index d590406cd8..477d28b6e0 100644
--- a/src/mbgl/layer/symbol_layer.cpp
+++ b/src/mbgl/layer/symbol_layer.cpp
@@ -121,7 +121,7 @@ std::unique_ptr<Bucket> SymbolLayer::createBucket(StyleBucketParameters& paramet
StyleCalculationParameters p(parameters.tileID.z);
bucket->layout.placement.calculate(p);
- if (bucket->layout.placement.value == PlacementType::Line) {
+ if (bucket->layout.placement.value == SymbolPlacementType::Line) {
bucket->layout.icon.rotationAlignment.value = RotationAlignmentType::Map;
bucket->layout.text.rotationAlignment.value = RotationAlignmentType::Map;
};
diff --git a/src/mbgl/layer/symbol_layer.hpp b/src/mbgl/layer/symbol_layer.hpp
index a2b3b0acf9..75759e2a19 100644
--- a/src/mbgl/layer/symbol_layer.hpp
+++ b/src/mbgl/layer/symbol_layer.hpp
@@ -11,7 +11,7 @@ class SpriteAtlas;
class SymbolLayoutProperties {
public:
- LayoutProperty<PlacementType> placement { PlacementType::Point };
+ LayoutProperty<SymbolPlacementType> placement { SymbolPlacementType::Point };
LayoutProperty<float> spacing { 250.0f };
LayoutProperty<bool> avoidEdges { false };
diff --git a/src/mbgl/renderer/symbol_bucket.cpp b/src/mbgl/renderer/symbol_bucket.cpp
index e189104490..1bc38fe066 100644
--- a/src/mbgl/renderer/symbol_bucket.cpp
+++ b/src/mbgl/renderer/symbol_bucket.cpp
@@ -163,7 +163,7 @@ void SymbolBucket::parseFeatures(const GeometryTileLayer& layer,
}
}
- if (layout.placement == PlacementType::Line) {
+ if (layout.placement == SymbolPlacementType::Line) {
util::mergeLines(features);
}
}
@@ -238,7 +238,7 @@ void SymbolBucket::addFeatures(uintptr_t tileUID,
if (feature.label.length()) {
shapedText = fontStack->getShaping(
/* string */ feature.label,
- /* maxWidth: ems */ layout.placement != PlacementType::Line ?
+ /* maxWidth: ems */ layout.placement != SymbolPlacementType::Line ?
layout.text.maxWidth * 24 : 0,
/* lineHeight: ems */ layout.text.lineHeight * 24,
/* horizontalAlign */ horizontalAlign,
@@ -289,19 +289,19 @@ void SymbolBucket::addFeature(const GeometryCollection &lines,
const float textMaxBoxScale = tilePixelRatio * layout.textMaxSize / glyphSize;
const float iconBoxScale = tilePixelRatio * layout.icon.size;
const float symbolSpacing = tilePixelRatio * layout.spacing;
- const bool avoidEdges = layout.avoidEdges && layout.placement != PlacementType::Line;
+ const bool avoidEdges = layout.avoidEdges && layout.placement != SymbolPlacementType::Line;
const float textPadding = layout.text.padding * tilePixelRatio;
const float iconPadding = layout.icon.padding * tilePixelRatio;
const float textMaxAngle = layout.text.maxAngle * util::DEG2RAD;
const bool textAlongLine =
layout.text.rotationAlignment == RotationAlignmentType::Map &&
- layout.placement == PlacementType::Line;
+ layout.placement == SymbolPlacementType::Line;
const bool iconAlongLine =
layout.icon.rotationAlignment == RotationAlignmentType::Map &&
- layout.placement == PlacementType::Line;
+ layout.placement == SymbolPlacementType::Line;
const bool mayOverlap = layout.text.allowOverlap || layout.icon.allowOverlap ||
layout.text.ignorePlacement || layout.icon.ignorePlacement;
- const bool isLine = layout.placement == PlacementType::Line;
+ const bool isLine = layout.placement == SymbolPlacementType::Line;
const float textRepeatDistance = symbolSpacing / 2;
auto& clippedLines = isLine ?
@@ -373,10 +373,10 @@ void SymbolBucket::placeFeatures(CollisionTile& collisionTile) {
const bool textAlongLine =
layout.text.rotationAlignment == RotationAlignmentType::Map &&
- layout.placement == PlacementType::Line;
+ layout.placement == SymbolPlacementType::Line;
const bool iconAlongLine =
layout.icon.rotationAlignment == RotationAlignmentType::Map &&
- layout.placement == PlacementType::Line;
+ layout.placement == SymbolPlacementType::Line;
const bool mayOverlap = layout.text.allowOverlap || layout.icon.allowOverlap ||
layout.text.ignorePlacement || layout.icon.ignorePlacement;
diff --git a/src/mbgl/style/function.cpp b/src/mbgl/style/function.cpp
index a3427fd4d1..55643ed43f 100644
--- a/src/mbgl/style/function.cpp
+++ b/src/mbgl/style/function.cpp
@@ -21,7 +21,7 @@ template <> inline TranslateAnchorType defaultStopsValue() { return {}; };
template <> inline RotateAnchorType defaultStopsValue() { return {}; };
template <> inline LineCapType defaultStopsValue() { return {}; };
template <> inline LineJoinType defaultStopsValue() { return {}; };
-template <> inline PlacementType defaultStopsValue() { return {}; };
+template <> inline SymbolPlacementType defaultStopsValue() { return {}; };
template <> inline TextAnchorType defaultStopsValue() { return {}; };
template <> inline TextJustifyType defaultStopsValue() { return {}; };
template <> inline TextTransformType defaultStopsValue() { return {}; };
@@ -86,7 +86,7 @@ template class Function<TranslateAnchorType>;
template class Function<RotateAnchorType>;
template class Function<LineCapType>;
template class Function<LineJoinType>;
-template class Function<PlacementType>;
+template class Function<SymbolPlacementType>;
template class Function<TextAnchorType>;
template class Function<TextJustifyType>;
template class Function<TextTransformType>;
diff --git a/src/mbgl/style/property_parsing.cpp b/src/mbgl/style/property_parsing.cpp
index d1f3fb350d..879f61411a 100644
--- a/src/mbgl/style/property_parsing.cpp
+++ b/src/mbgl/style/property_parsing.cpp
@@ -121,13 +121,13 @@ optional<LineJoinType> parseProperty<LineJoinType>(const char* name, const JSVal
}
template <>
-optional<PlacementType> parseProperty<PlacementType>(const char* name, const JSValue& value) {
+optional<SymbolPlacementType> parseProperty<SymbolPlacementType>(const char* name, const JSValue& value) {
if (!value.IsString()) {
Log::Warning(Event::ParseStyle, "value of '%s' must be a string", name);
return {};
}
- return { PlacementTypeClass({ value.GetString(), value.GetStringLength() }) };
+ return { SymbolPlacementTypeClass({ value.GetString(), value.GetStringLength() }) };
}
template <>
@@ -330,8 +330,8 @@ template <> optional<Function<LineJoinType>> parseProperty(const char* name, con
return parseFunction<LineJoinType>(name, value);
}
-template <> optional<Function<PlacementType>> parseProperty(const char* name, const JSValue& value) {
- return parseFunction<PlacementType>(name, value);
+template <> optional<Function<SymbolPlacementType>> parseProperty(const char* name, const JSValue& value) {
+ return parseFunction<SymbolPlacementType>(name, value);
}
template <> optional<Function<TextAnchorType>> parseProperty(const char* name, const JSValue& value) {
diff --git a/src/mbgl/util/interpolate.hpp b/src/mbgl/util/interpolate.hpp
index 7d8627e7d6..7d1a857e8e 100644
--- a/src/mbgl/util/interpolate.hpp
+++ b/src/mbgl/util/interpolate.hpp
@@ -40,7 +40,7 @@ template<> inline TranslateAnchorType interpolate(const TranslateAnchorType a, c
template<> inline RotateAnchorType interpolate(const RotateAnchorType a, const RotateAnchorType, const double) { return a; }
template<> inline LineCapType interpolate(const LineCapType a, const LineCapType, const double) { return a; }
template<> inline LineJoinType interpolate(const LineJoinType a, const LineJoinType, const double) { return a; }
-template<> inline PlacementType interpolate(const PlacementType a, const PlacementType, const double) { return a; }
+template<> inline SymbolPlacementType interpolate(const SymbolPlacementType a, const SymbolPlacementType, const double) { return a; }
template<> inline TextAnchorType interpolate(const TextAnchorType a, const TextAnchorType, const double) { return a; }
template<> inline TextJustifyType interpolate(const TextJustifyType a, const TextJustifyType, const double) { return a; }
template<> inline TextTransformType interpolate(const TextTransformType a, const TextTransformType, const double) { return a; }