diff --git a/include/mbgl/style/style_bucket.hpp b/include/mbgl/style/style_bucket.hpp index a868659ad..530e0c125 100644 --- a/include/mbgl/style/style_bucket.hpp +++ b/include/mbgl/style/style_bucket.hpp @@ -66,7 +66,7 @@ public: TextJustifyType justify = TextJustifyType::Center; TextHorizontalAlignType horizontal_align = TextHorizontalAlignType::Center; TextVerticalAlignType vertical_align = TextVerticalAlignType::Center; - float max_angle_delta = 45.0f /* degrees */; + float max_angle = 45.0f /* degrees */; float rotate = 0.0f; float slant = 0.0f; float padding = 2.0f; diff --git a/src/style/style_parser.cpp b/src/style/style_parser.cpp index 27deca689..a8857bdce 100644 --- a/src/style/style_parser.cpp +++ b/src/style/style_parser.cpp @@ -908,7 +908,7 @@ void StyleParser::parseRender(JSVal value, std::shared_ptr &layer) { parseRenderProperty(value, render.text.justify, "text-justify"); parseRenderProperty(value, render.text.horizontal_align, "text-horizontal-align"); parseRenderProperty(value, render.text.vertical_align, "text-vertical-align"); - parseRenderProperty(value, render.text.max_angle_delta, "text-max-angle"); + parseRenderProperty(value, render.text.max_angle, "text-max-angle"); parseRenderProperty(value, render.text.rotate, "text-rotate"); parseRenderProperty(value, render.text.slant, "text-slant"); parseRenderProperty(value, render.text.padding, "text-padding"); diff --git a/src/text/placement.cpp b/src/text/placement.cpp index 23e2a0ee8..ac95ade5e 100644 --- a/src/text/placement.cpp +++ b/src/text/placement.cpp @@ -28,7 +28,7 @@ typedef std::vector GlyphInstances; void getSegmentGlyphs(std::back_insert_iterator glyphs, Anchor &anchor, float offset, const std::vector &line, int segment, - int8_t direction, float maxAngleDelta) { + int8_t direction, float maxAngle) { const bool upsideDown = direction < 0; if (offset < 0) @@ -60,7 +60,7 @@ void getSegmentGlyphs(std::back_insert_iterator glyphs, Anchor & // Don't place around sharp corners float angleDiff = std::fmod((angle - prevAngle), (2.0f * M_PI)); - if (prevAngle && std::fabs(angleDiff) > maxAngleDelta) { + if (prevAngle && std::fabs(angleDiff) > maxAngle) { anchor.scale = prevscale; break; } @@ -202,7 +202,7 @@ Placement Placement::getGlyphs(Anchor &anchor, const vec2 &origin, const const GlyphPositions &face, float boxScale, bool horizontal, const std::vector &line, const StyleBucketSymbol &props) { - const float maxAngleDelta = props.text.max_angle_delta * M_PI / 180; + const float maxAngle = props.text.max_angle * M_PI / 180; const float rotate = props.text.rotate * M_PI / 180; const float padding = props.text.padding; const bool alongLine = props.text.rotation_alignment != RotationAlignmentType::Viewport; @@ -233,10 +233,10 @@ Placement Placement::getGlyphs(Anchor &anchor, const vec2 &origin, const GlyphInstances glyphInstances; if (anchor.segment >= 0 && alongLine) { getSegmentGlyphs(std::back_inserter(glyphInstances), anchor, x, line, anchor.segment, 1, - maxAngleDelta); + maxAngle); if (keepUpright) getSegmentGlyphs(std::back_inserter(glyphInstances), anchor, x, line, - anchor.segment, -1, maxAngleDelta); + anchor.segment, -1, maxAngle); } else { glyphInstances.emplace_back(GlyphInstance{anchor});