From edbad2664b864d8771e496c754963328b848dadc Mon Sep 17 00:00:00 2001 From: artemp Date: Mon, 29 Jun 2015 15:01:08 +0200 Subject: [PATCH] add `margin` as directed inflation of bbox --- src/text/placement_finder.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/text/placement_finder.cpp b/src/text/placement_finder.cpp index 9664e0d15..fdc62388e 100644 --- a/src/text/placement_finder.cpp +++ b/src/text/placement_finder.cpp @@ -142,10 +142,10 @@ bool placement_finder::find_point_placement(pixel_position const& pos) box2d bbox = layout.bounds(); bbox.re_center(layout_center.x, layout_center.y); - // For point placements it is faster to just check the bounding box. */ - //if (collision(bbox, layouts_.text(), false)) return false; + // TODO + double margin = (text_props_->margin != 0 ? text_props_->margin : text_props_->minimum_distance) * scale_factor_; + if (!text_props_->allow_overlap && !detector_.has_placement(bbox, margin, angle)) return false; - if (!text_props_->allow_overlap && !detector_.has_placement(bbox, 0, angle)) return false; if (layout.num_lines()) labels.push_back(std::make_tuple(bbox,angle)); pixel_position layout_offset = layout_center - glyphs->get_base_point();