Пример #1
0
bool placement_finder::add_marker(glyph_positions_ptr glyphs, pixel_position const& pos, bool line_placement, agg::trans_affine const& placement_tr) const
{
    pixel_position real_pos = (marker_unlocked_ ? pos : glyphs->get_base_point()) + marker_displacement_;
    box2d<double> bbox = marker_box_;
    bbox.move(real_pos.x, real_pos.y);

    if(!line_placement && text_props_->adjust_edges)
    {
        edge_placement_adjuster adjuster;
        agg::trans_affine tr;
        tr *= marker_->transform; //apply any transform specified in the style xml
        tr *= placement_tr; //apply any special placement transform
        if(adjuster.adjust_edge_placement(tr, marker_box_, detector_.extent(), bbox, real_pos.x, real_pos.y))
        {
            bbox = marker_box_;
            bbox.move(real_pos.x, real_pos.y);
            if(!marker_unlocked_)
            {
                glyphs->set_base_point(real_pos);
            }
        }
    }

    //WI: Added John's changes for marker rotation 13NOV2014 (transform in general)
    glyphs->set_marker(marker_, real_pos, bbox, placement_tr);

    if (collision(bbox, layouts_.text(), line_placement)) return false;
    detector_.insert(bbox);
    return true;
}
Пример #2
0
bool placement_finder::add_marker(glyph_positions_ptr glyphs, pixel_position const& pos) const
{
    pixel_position real_pos = (marker_unlocked_ ? pos : glyphs->get_base_point()) + marker_displacement_;
    box2d<double> bbox = marker_box_;
    bbox.move(real_pos.x, real_pos.y);
    glyphs->set_marker(marker_, real_pos);
    if (collision(bbox, layouts_.text(), false)) return false;
    detector_.insert(bbox);
    return true;
}