fix conditional pixel snapping for marker rasters
This commit is contained in:
parent
3412c071ab
commit
c6a291271f
2 changed files with 16 additions and 5 deletions
|
@ -241,6 +241,8 @@ struct raster_markers_rasterizer_dispatch : mapnik::noncopyable
|
||||||
{
|
{
|
||||||
agg::rendering_buffer src_buffer((unsigned char *)src_.getBytes(),src_.width(),src_.height(),src_.width() * 4);
|
agg::rendering_buffer src_buffer((unsigned char *)src_.getBytes(),src_.width(),src_.height(),src_.width() * 4);
|
||||||
pixfmt_pre pixf_mask(src_buffer);
|
pixfmt_pre pixf_mask(src_buffer);
|
||||||
|
if (snap_to_pixels_)
|
||||||
|
{
|
||||||
renb_.blend_from(pixf_mask,
|
renb_.blend_from(pixf_mask,
|
||||||
0,
|
0,
|
||||||
std::floor(marker_tr.tx + .5),
|
std::floor(marker_tr.tx + .5),
|
||||||
|
@ -248,6 +250,15 @@ struct raster_markers_rasterizer_dispatch : mapnik::noncopyable
|
||||||
unsigned(255*opacity));
|
unsigned(255*opacity));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
renb_.blend_from(pixf_mask,
|
||||||
|
0,
|
||||||
|
marker_tr.tx,
|
||||||
|
marker_tr.ty,
|
||||||
|
unsigned(255*opacity));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
using img_accessor_type = agg::image_accessor_clone<pixfmt_pre>;
|
using img_accessor_type = agg::image_accessor_clone<pixfmt_pre>;
|
||||||
using interpolator_type = agg::span_interpolator_linear<>;
|
using interpolator_type = agg::span_interpolator_linear<>;
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Loading…
Reference in a new issue