summaryrefslogtreecommitdiff
path: root/src/mbgl/text/quads.cpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-02-09 17:42:38 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-03-01 20:58:54 +0000
commit411a562061f404fa7174222f38a1a9a13a396fd9 (patch)
treefcbc295f48d48d86f75ced98b8a9ad137cf5bce0 /src/mbgl/text/quads.cpp
parent9955087767d226c09816d562be39be1f1a1e84c5 (diff)
downloadqtlocation-mapboxgl-411a562061f404fa7174222f38a1a9a13a396fd9.tar.gz
[core] Enforce constants usage
Use 'LATITUDE_MAX', 'LONGITUDE_MAX', 'DEG2RAD' and 'RAD2DEG' whenever possible.
Diffstat (limited to 'src/mbgl/text/quads.cpp')
-rw-r--r--src/mbgl/text/quads.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mbgl/text/quads.cpp b/src/mbgl/text/quads.cpp
index 92866566d8..1950f41fc7 100644
--- a/src/mbgl/text/quads.cpp
+++ b/src/mbgl/text/quads.cpp
@@ -3,6 +3,7 @@
#include <mbgl/geometry/anchor.hpp>
#include <mbgl/layer/symbol_layer.hpp>
#include <mbgl/util/math.hpp>
+#include <mbgl/util/constants.hpp>
#include <cassert>
namespace mbgl {
@@ -26,7 +27,7 @@ SymbolQuads getIconQuads(Anchor& anchor, const PositionedIcon& shapedIcon,
vec2<float> bl{left, bottom};
- float angle = layout.icon.rotate * M_PI / 180.0f;
+ float angle = layout.icon.rotate * util::DEG2RAD;
if (alongLine) {
assert(static_cast<unsigned int>(anchor.segment) < line.size());
const Coordinate &prev= line[anchor.segment];
@@ -134,7 +135,7 @@ SymbolQuads getGlyphQuads(Anchor& anchor, const Shaping& shapedText,
const float boxScale, const std::vector<Coordinate>& line, const SymbolLayoutProperties& layout,
const bool alongLine, const GlyphPositions& face) {
- const float textRotate = layout.text.rotate * M_PI / 180;
+ const float textRotate = layout.text.rotate * util::DEG2RAD;
const bool keepUpright = layout.text.keepUpright;
SymbolQuads quads;