summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-08-05 13:51:21 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-08-05 13:51:21 +0200
commit3946437d878aeefa5cc82183fccc1ed547a7dd84 (patch)
treefe82692ce433031ae062446c058b7955c4603d1c /src
parent1a95ec3a651bbb83e51ce554d99cdc5f3693a016 (diff)
downloadqtlocation-mapboxgl-3946437d878aeefa5cc82183fccc1ed547a7dd84.tar.gz
port js algorithm
Diffstat (limited to 'src')
-rw-r--r--src/text/collision.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/text/collision.cpp b/src/text/collision.cpp
index 337251fcd6..9ff67b7156 100644
--- a/src/text/collision.cpp
+++ b/src/text/collision.cpp
@@ -272,8 +272,7 @@ void Collision::insert(const GlyphBoxes &glyphs, const CollisionAnchor &anchor,
const float minScale = util::max(placementScale, glyph.minScale);
const float maxScale = glyph.maxScale || std::numeric_limits<float>::infinity();
- Box bounds{Point{anchor.x + bbox.tl.x / minScale, anchor.y + bbox.tl.y / minScale},
- Point{anchor.x + bbox.br.x / minScale, anchor.y + bbox.br.y / minScale}};
+ const Box bounds = getBox(anchor, bbox, minScale, maxScale);
PlacementBox placement;
placement.anchor = anchor;
@@ -286,9 +285,6 @@ void Collision::insert(const GlyphBoxes &glyphs, const CollisionAnchor &anchor,
placement.maxScale = maxScale;
placement.padding = glyph.padding;
- assert(!isnan(bounds.min_corner().get<0>()) && !isnan(bounds.min_corner().get<1>()));
- assert(!isnan(bounds.max_corner().get<0>()) && !isnan(bounds.max_corner().get<1>()));
-
allBounds.emplace_back(bounds, placement);
}