+ auto detect paths orientation
+ not need to set clip box on rasterizer it's already set (fixes gap when label is overlapping border)
This commit is contained in:
parent
e53b490167
commit
d5f0a497a8
4 changed files with 6 additions and 8 deletions
|
@ -61,19 +61,17 @@ public:
|
|||
Scanline& sl,
|
||||
Renderer& ren,
|
||||
agg::trans_affine const& mtx,
|
||||
agg::rect_i const& cb,
|
||||
double opacity=1.0)
|
||||
|
||||
{
|
||||
using namespace agg;
|
||||
|
||||
ras.clip_box(cb.x1, cb.y1, cb.x2, cb.y2);
|
||||
trans_affine transform;
|
||||
curved_stroked_trans_type curved_stroked_trans(curved_stroked_,transform);
|
||||
curved_trans_type curved_trans(curved_,transform);
|
||||
curved_trans_contour_type curved_trans_contour(curved_trans);
|
||||
|
||||
curved_trans_contour.auto_detect_orientation(false);
|
||||
curved_trans_contour.auto_detect_orientation(true);
|
||||
|
||||
for(unsigned i = 0; i < attributes_.size(); ++i)
|
||||
{
|
||||
|
@ -81,7 +79,7 @@ public:
|
|||
transform = attr.transform;
|
||||
transform *= mtx;
|
||||
double scl = transform.scale();
|
||||
//m_curved.approximation_method(curve_inc);
|
||||
//curved_.approximation_method(curve_inc);
|
||||
curved_.approximation_scale(scl);
|
||||
curved_.angle_tolerance(0.0);
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ void agg_renderer<T>::process(markers_symbolizer const& sym,
|
|||
while (placement.get_point(&x, &y, &angle))
|
||||
{
|
||||
agg::trans_affine matrix = recenter * tr *agg::trans_affine_rotation(angle) * agg::trans_affine_translation(x, y);
|
||||
svg_renderer.render(*ras_ptr, sl, ren, matrix, renb.clip_box(), sym.get_opacity());
|
||||
svg_renderer.render(*ras_ptr, sl, ren, matrix, sym.get_opacity());
|
||||
if (writer.first)
|
||||
//writer.first->add_box(label_ext, feature, t_, writer.second);
|
||||
std::clog << "### Warning metawriter not yet supported for LINE placement\n";
|
||||
|
|
|
@ -113,7 +113,7 @@ void agg_renderer<T>::process(point_symbolizer const& sym,
|
|||
if (sym.get_allow_overlap() ||
|
||||
detector_.has_placement(extent))
|
||||
{
|
||||
svg_renderer.render(*ras_ptr, sl, ren, tr, renb.clip_box(), sym.get_opacity());
|
||||
svg_renderer.render(*ras_ptr, sl, ren, tr, sym.get_opacity());
|
||||
if (!sym.get_ignore_placement())
|
||||
detector_.insert(extent);
|
||||
metawriter_with_properties writer = sym.get_metawriter();
|
||||
|
|
|
@ -194,7 +194,7 @@ void agg_renderer<T>::process(shield_symbolizer const& sym,
|
|||
if ( sym.get_allow_overlap() || detector_.has_placement(label_ext) )
|
||||
{
|
||||
agg::trans_affine matrix = recenter * tr * agg::trans_affine_translation(label_x, label_y);
|
||||
svg_renderer.render(*ras_ptr, sl, ren, matrix, renb.clip_box(), sym.get_opacity());
|
||||
svg_renderer.render(*ras_ptr, sl, ren, matrix, sym.get_opacity());
|
||||
box2d<double> dim = text_ren.prepare_glyphs(&text_placement.placements[0]);
|
||||
text_ren.render(x,y);
|
||||
detector_.insert(label_ext);
|
||||
|
@ -220,7 +220,7 @@ void agg_renderer<T>::process(shield_symbolizer const& sym,
|
|||
double x = floor(text_placement.placements[ii].starting_x);
|
||||
double y = floor(text_placement.placements[ii].starting_y);
|
||||
agg::trans_affine matrix = recenter * tr * agg::trans_affine_translation(x, y);
|
||||
svg_renderer.render(*ras_ptr, sl, ren, matrix, renb.clip_box(), sym.get_opacity());
|
||||
svg_renderer.render(*ras_ptr, sl, ren, matrix, sym.get_opacity());
|
||||
if (writer.first) writer.first->add_box(box2d<double>(x,y,x+w,y+h), feature, t_, writer.second);
|
||||
box2d<double> dim = text_ren.prepare_glyphs(&text_placement.placements[ii]);
|
||||
text_ren.render(x,y);
|
||||
|
|
Loading…
Reference in a new issue