snap to pixels for markers because calculating placement

This commit is contained in:
Dane Springmeyer 2013-03-12 12:14:01 -07:00
parent 1bf3e89de0
commit 86ad6c0dab

View file

@ -114,17 +114,18 @@ struct vector_markers_rasterizer_dispatch
}
agg::trans_affine matrix = marker_trans_;
matrix.translate(x,y);
box2d<double> transformed_bbox = bbox_ * matrix;
if (sym_.get_allow_overlap() ||
detector_.has_placement(transformed_bbox))
{
if (snap_to_pixels_)
{
// https://github.com/mapnik/mapnik/issues/1316
matrix.tx = std::floor(matrix.tx+.5);
matrix.ty = std::floor(matrix.ty+.5);
}
// TODO https://github.com/mapnik/mapnik/issues/1754
box2d<double> transformed_bbox = bbox_ * matrix;
if (sym_.get_allow_overlap() ||
detector_.has_placement(transformed_bbox))
{
svg_renderer_.render(ras_, sl_, renb_, matrix, sym_.get_opacity(), bbox_);
if (!sym_.get_ignore_placement())
{