summaryrefslogtreecommitdiff
path: root/src/mbgl/text/placement.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-02-17 18:09:34 -0800
committerKonstantin Käfer <mail@kkaefer.com>2015-02-17 18:27:51 -0800
commitc07fa069944b42890aa419cfe542ed98add57037 (patch)
treee4b43fd47c24633a649d65608387ee4a1eb5f80f /src/mbgl/text/placement.cpp
parent89c0ff5f3955ecd4316a7b4280e995b7b431817d (diff)
downloadqtlocation-mapboxgl-c07fa069944b42890aa419cfe542ed98add57037.tar.gz
rename StyleBucket* => StyleLayout*
and remove a few unused variables refs #881
Diffstat (limited to 'src/mbgl/text/placement.cpp')
-rw-r--r--src/mbgl/text/placement.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp
index 27e2b7010f..9d9e82c75c 100644
--- a/src/mbgl/text/placement.cpp
+++ b/src/mbgl/text/placement.cpp
@@ -4,6 +4,7 @@
#include <mbgl/text/placement.hpp>
#include <mbgl/text/glyph_store.hpp>
#include <mbgl/style/style_bucket.hpp>
+#include <mbgl/style/style_layout.hpp>
#include <mbgl/util/math.hpp>
@@ -129,10 +130,10 @@ GlyphBox getMergedBoxes(const GlyphBoxes &glyphs, const Anchor &anchor) {
}
Placement Placement::getIcon(Anchor &anchor, const Rect<uint16_t> &image, float boxScale,
- const std::vector<Coordinate> &line, const StyleBucketSymbol &props) {
+ const std::vector<Coordinate> &line, const StyleLayoutSymbol &layout) {
- const float dx = props.icon.offset[0];
- const float dy = props.icon.offset[1];
+ const float dx = layout.icon.offset[0];
+ const float dy = layout.icon.offset[1];
float x1 = dx - image.originalW / 2.0f;
float x2 = x1 + image.w;
float y1 = dy - image.originalH / 2.0f;
@@ -143,8 +144,8 @@ Placement Placement::getIcon(Anchor &anchor, const Rect<uint16_t> &image, float
vec2<float> br{x2, y2};
vec2<float> bl{x1, y2};
- float angle = props.icon.rotate * M_PI / 180.0f;
- if (anchor.segment >= 0 && props.icon.rotation_alignment != RotationAlignmentType::Viewport) {
+ float angle = layout.icon.rotate * M_PI / 180.0f;
+ if (anchor.segment >= 0 && layout.icon.rotation_alignment != RotationAlignmentType::Viewport) {
const Coordinate &next = line[anchor.segment];
angle += -std::atan2(next.x - anchor.x, next.y - anchor.y) + M_PI / 2;
}
@@ -178,7 +179,7 @@ Placement Placement::getIcon(Anchor &anchor, const Rect<uint16_t> &image, float
/* anchor */ anchor,
/* minScale */ Placement::globalMinScale,
/* maxScale */ std::numeric_limits<float>::infinity(),
- /* padding */ props.icon.padding);
+ /* padding */ layout.icon.padding);
placement.shapes.emplace_back(
/* tl */ tl,
@@ -199,12 +200,12 @@ Placement Placement::getIcon(Anchor &anchor, const Rect<uint16_t> &image, float
Placement Placement::getGlyphs(Anchor &anchor, const vec2<float> &origin, const Shaping &shaping,
const GlyphPositions &face, float boxScale, bool horizontal,
const std::vector<Coordinate> &line,
- const StyleBucketSymbol &props) {
- 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;
- const bool keepUpright = props.text.keep_upright;
+ const StyleLayoutSymbol &layout) {
+ const float maxAngle = layout.text.max_angle * M_PI / 180;
+ const float rotate = layout.text.rotate * M_PI / 180;
+ const float padding = layout.text.padding;
+ const bool alongLine = layout.text.rotation_alignment != RotationAlignmentType::Viewport;
+ const bool keepUpright = layout.text.keep_upright;
Placement placement;