From 3946437d878aeefa5cc82183fccc1ed547a7dd84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Tue, 5 Aug 2014 13:51:21 +0200 Subject: [PATCH] port js algorithm --- src/text/collision.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/text/collision.cpp b/src/text/collision.cpp index 337251fcd..9ff67b715 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::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); }