summaryrefslogtreecommitdiff
path: root/src/text/placement.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-08-05 14:54:31 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-08-05 14:54:31 +0200
commit23ceaf7d6657b07116d9e4b1512ecda55e188917 (patch)
tree1c82e78c1db5318cf293fe73c9a58ba84c95c954 /src/text/placement.cpp
parent86e137664c7f045d73c1cff3adca63f3ef7690f7 (diff)
downloadqtlocation-mapboxgl-23ceaf7d6657b07116d9e4b1512ecda55e188917.tar.gz
code style fixes
Diffstat (limited to 'src/text/placement.cpp')
-rw-r--r--src/text/placement.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/text/placement.cpp b/src/text/placement.cpp
index 7652327782..26cc9f70f7 100644
--- a/src/text/placement.cpp
+++ b/src/text/placement.cpp
@@ -210,9 +210,6 @@ Placement Placement::getGlyphs(Anchor &anchor, const vec2<float> &origin, const
Placement placement;
- PlacedGlyphs &glyphs = placement.shapes;
- GlyphBoxes &boxes = placement.boxes;
-
const uint32_t buffer = 3;
for (const PositionedGlyph &shape : shaping) {
@@ -281,7 +278,7 @@ Placement Placement::getGlyphs(Anchor &anchor, const vec2<float> &origin, const
const float glyphMinScale = std::max(instance.minScale, anchor.scale);
// Remember the glyph for later insertion.
- glyphs.emplace_back(
+ placement.shapes.emplace_back(
tl, tr, bl, br, rect,
float(std::fmod((anchor.angle + rotate + instance.offset + 2 * M_PI), (2 * M_PI))),
instance.anchor, glyphMinScale, instance.maxScale);
@@ -294,18 +291,18 @@ Placement Placement::getGlyphs(Anchor &anchor, const vec2<float> &origin, const
boxScale * util::max(tl.x, tr.x, bl.x, br.x),
boxScale * util::max(tl.y, tr.y, bl.y, br.y)};
}
- boxes.emplace_back(box, instance.anchor, glyphMinScale, instance.maxScale, padding);
+ placement.boxes.emplace_back(box, instance.anchor, glyphMinScale, instance.maxScale, padding);
}
}
}
// TODO avoid creating the boxes in the first place?
if (horizontal)
- boxes = {getMergedBoxes(boxes, anchor)};
+ placement.boxes = {getMergedBoxes(placement.boxes, anchor)};
const float minPlacementScale = anchor.scale;
placement.minScale = std::numeric_limits<float>::infinity();
- for (const GlyphBox &box : boxes) {
+ for (const GlyphBox &box : placement.boxes) {
placement.minScale = util::min(placement.minScale, box.minScale);
}
placement.minScale = util::max(minPlacementScale, Placement::globalMinScale);