add margin
as directed inflation of bbox
This commit is contained in:
parent
bac031e6f6
commit
edbad2664b
1 changed files with 3 additions and 3 deletions
|
@ -142,10 +142,10 @@ bool placement_finder::find_point_placement(pixel_position const& pos)
|
||||||
box2d<double> bbox = layout.bounds();
|
box2d<double> bbox = layout.bounds();
|
||||||
bbox.re_center(layout_center.x, layout_center.y);
|
bbox.re_center(layout_center.x, layout_center.y);
|
||||||
|
|
||||||
// For point placements it is faster to just check the bounding box. */
|
// TODO
|
||||||
//if (collision(bbox, layouts_.text(), false)) return false;
|
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));
|
if (layout.num_lines()) labels.push_back(std::make_tuple(bbox,angle));
|
||||||
|
|
||||||
pixel_position layout_offset = layout_center - glyphs->get_base_point();
|
pixel_position layout_offset = layout_center - glyphs->get_base_point();
|
||||||
|
|
Loading…
Add table
Reference in a new issue