diff --git a/include/mbgl/style/types.hpp b/include/mbgl/style/types.hpp index 97a648210..31be19cdc 100644 --- a/include/mbgl/style/types.hpp +++ b/include/mbgl/style/types.hpp @@ -56,16 +56,16 @@ MBGL_DEFINE_ENUM_CLASS(VisibilityTypeClass, VisibilityType, { // ------------------------------------------------------------------------------------------------- -enum class CapType : uint8_t { +enum class LineCapType : uint8_t { Round, Butt, Square, }; -MBGL_DEFINE_ENUM_CLASS(CapTypeClass, CapType, { - { CapType::Round, "round" }, - { CapType::Butt, "butt" }, - { CapType::Square, "square" }, +MBGL_DEFINE_ENUM_CLASS(LineCapTypeClass, LineCapType, { + { LineCapType::Round, "round" }, + { LineCapType::Butt, "butt" }, + { LineCapType::Square, "square" }, }); // ------------------------------------------------------------------------------------------------- diff --git a/src/mbgl/layer/line_layer.hpp b/src/mbgl/layer/line_layer.hpp index 200541c62..0aa8d3af8 100644 --- a/src/mbgl/layer/line_layer.hpp +++ b/src/mbgl/layer/line_layer.hpp @@ -9,7 +9,7 @@ namespace mbgl { class LineLayoutProperties { public: - LayoutProperty cap { CapType::Butt }; + LayoutProperty cap { LineCapType::Butt }; LayoutProperty join { JoinType::Miter }; LayoutProperty miterLimit { 2.0f }; LayoutProperty roundLimit { 1.0f }; diff --git a/src/mbgl/renderer/line_bucket.cpp b/src/mbgl/renderer/line_bucket.cpp index 83a14acbc..2ae2998b9 100644 --- a/src/mbgl/renderer/line_bucket.cpp +++ b/src/mbgl/renderer/line_bucket.cpp @@ -80,8 +80,8 @@ void LineBucket::addGeometry(const GeometryCoordinates& vertices) { return; } - const CapType beginCap = layout.cap; - const CapType endCap = closed ? CapType::Butt : CapType(layout.cap); + const LineCapType beginCap = layout.cap; + const LineCapType endCap = closed ? LineCapType::Butt : LineCapType(layout.cap); double distance = 0; bool startOfLine = true; @@ -173,7 +173,7 @@ void LineBucket::addGeometry(const GeometryCoordinates& vertices) { // The join if a middle vertex, otherwise the cap const bool middleVertex = prevVertex && nextVertex; JoinType currentJoin = layout.join; - const CapType currentCap = nextVertex ? beginCap : endCap; + const LineCapType currentCap = nextVertex ? beginCap : endCap; if (middleVertex) { if (currentJoin == JoinType::Round) { @@ -279,7 +279,7 @@ void LineBucket::addGeometry(const GeometryCoordinates& vertices) { false, startVertex, triangleStore); } - } else if (!middleVertex && currentCap == CapType::Butt) { + } else if (!middleVertex && currentCap == LineCapType::Butt) { if (!startOfLine) { // Close previous segment with a butt addCurrentVertex(currentVertex, distance, prevNormal, 0, 0, false, @@ -292,7 +292,7 @@ void LineBucket::addGeometry(const GeometryCoordinates& vertices) { startVertex, triangleStore); } - } else if (!middleVertex && currentCap == CapType::Square) { + } else if (!middleVertex && currentCap == LineCapType::Square) { if (!startOfLine) { // Close previous segment with a square cap addCurrentVertex(currentVertex, distance, prevNormal, 1, 1, false, @@ -308,7 +308,7 @@ void LineBucket::addGeometry(const GeometryCoordinates& vertices) { startVertex, triangleStore); } - } else if (middleVertex ? currentJoin == JoinType::Round : currentCap == CapType::Round) { + } else if (middleVertex ? currentJoin == JoinType::Round : currentCap == LineCapType::Round) { if (!startOfLine) { // Close previous segment with a butt addCurrentVertex(currentVertex, distance, prevNormal, 0, 0, false, diff --git a/src/mbgl/renderer/painter_line.cpp b/src/mbgl/renderer/painter_line.cpp index 13515c5ce..1ea5e932e 100644 --- a/src/mbgl/renderer/painter_line.cpp +++ b/src/mbgl/renderer/painter_line.cpp @@ -78,8 +78,8 @@ void Painter::renderLine(LineBucket& bucket, const LineLayer& layer, const TileI linesdfShader->u_blur = blur; linesdfShader->u_color = color; - LinePatternPos posA = lineAtlas->getDashPosition(properties.dasharray.value.from, layout.cap == CapType::Round, glObjectStore); - LinePatternPos posB = lineAtlas->getDashPosition(properties.dasharray.value.to, layout.cap == CapType::Round, glObjectStore); + LinePatternPos posA = lineAtlas->getDashPosition(properties.dasharray.value.from, layout.cap == LineCapType::Round, glObjectStore); + LinePatternPos posB = lineAtlas->getDashPosition(properties.dasharray.value.to, layout.cap == LineCapType::Round, glObjectStore); const float widthA = posA.width * properties.dasharray.value.fromScale * properties.dashLineWidth; const float widthB = posB.width * properties.dasharray.value.toScale * properties.dashLineWidth; diff --git a/src/mbgl/style/function.cpp b/src/mbgl/style/function.cpp index 16af9c8fc..501f27fca 100644 --- a/src/mbgl/style/function.cpp +++ b/src/mbgl/style/function.cpp @@ -19,7 +19,7 @@ template <> inline std::array defaultStopsValue() { return {{ 0, 0 }}; template <> inline std:: string defaultStopsValue() { return {}; } template <> inline TranslateAnchorType defaultStopsValue() { return {}; }; template <> inline RotateAnchorType defaultStopsValue() { return {}; }; -template <> inline CapType defaultStopsValue() { return {}; }; +template <> inline LineCapType defaultStopsValue() { return {}; }; template <> inline JoinType defaultStopsValue() { return {}; }; template <> inline PlacementType defaultStopsValue() { return {}; }; template <> inline TextAnchorType defaultStopsValue() { return {}; }; @@ -84,7 +84,7 @@ template class Function>; template class Function; template class Function; template class Function; -template class Function; +template class Function; template class Function; template class Function; template class Function; diff --git a/src/mbgl/style/property_parsing.cpp b/src/mbgl/style/property_parsing.cpp index bdeb04c28..056c78bcf 100644 --- a/src/mbgl/style/property_parsing.cpp +++ b/src/mbgl/style/property_parsing.cpp @@ -101,13 +101,13 @@ optional parseProperty(const char* name, con } template <> -optional parseProperty(const char* name, const JSValue& value) { +optional parseProperty(const char* name, const JSValue& value) { if (!value.IsString()) { Log::Warning(Event::ParseStyle, "value of '%s' must be a string", name); return {}; } - return { CapTypeClass({ value.GetString(), value.GetStringLength() }) }; + return { LineCapTypeClass({ value.GetString(), value.GetStringLength() }) }; } template <> @@ -322,8 +322,8 @@ template <> optional> parseProperty(const char* name, return parseFunction(name, value); } -template <> optional> parseProperty(const char* name, const JSValue& value) { - return parseFunction(name, value); +template <> optional> parseProperty(const char* name, const JSValue& value) { + return parseFunction(name, value); } template <> optional> parseProperty(const char* name, const JSValue& value) { diff --git a/src/mbgl/util/interpolate.hpp b/src/mbgl/util/interpolate.hpp index 03d401c35..499783342 100644 --- a/src/mbgl/util/interpolate.hpp +++ b/src/mbgl/util/interpolate.hpp @@ -38,7 +38,7 @@ template<> inline std::vector interpolate(const std::vector a, con template<> inline std::string interpolate(const std::string a, const std::string, const double) { return a; } template<> inline TranslateAnchorType interpolate(const TranslateAnchorType a, const TranslateAnchorType, const double) { return a; } template<> inline RotateAnchorType interpolate(const RotateAnchorType a, const RotateAnchorType, const double) { return a; } -template<> inline CapType interpolate(const CapType a, const CapType, const double) { return a; } +template<> inline LineCapType interpolate(const LineCapType a, const LineCapType, const double) { return a; } template<> inline JoinType interpolate(const JoinType a, const JoinType, const double) { return a; } template<> inline PlacementType interpolate(const PlacementType a, const PlacementType, const double) { return a; } template<> inline TextAnchorType interpolate(const TextAnchorType a, const TextAnchorType, const double) { return a; }