Merge commit '71a04cd09da21680b6ad498fe4985eb157f34f35' into harfbuzz
This commit is contained in:
commit
0f7101b9b5
3 changed files with 11 additions and 10 deletions
|
@ -114,17 +114,18 @@ struct vector_markers_rasterizer_dispatch
|
|||
}
|
||||
agg::trans_affine matrix = marker_trans_;
|
||||
matrix.translate(x,y);
|
||||
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))
|
||||
{
|
||||
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);
|
||||
}
|
||||
svg_renderer_.render(ras_, sl_, renb_, matrix, sym_.get_opacity(), bbox_);
|
||||
if (!sym_.get_ignore_placement())
|
||||
{
|
||||
|
|
|
@ -111,7 +111,7 @@ private:
|
|||
void find_unused_nodes_recursive(xml_node const& node, std::string & error_text);
|
||||
|
||||
|
||||
std::string ensure_relative_to_xml(boost::optional<std::string> opt_path);
|
||||
std::string ensure_relative_to_xml(boost::optional<std::string> const& opt_path);
|
||||
void ensure_exists(std::string const& file_path);
|
||||
boost::optional<color> get_opt_color_attr(boost::property_tree::ptree const& node,
|
||||
std::string const& name);
|
||||
|
@ -1635,7 +1635,7 @@ void map_parser::ensure_font_face(std::string const& face_name)
|
|||
}
|
||||
}
|
||||
|
||||
std::string map_parser::ensure_relative_to_xml(boost::optional<std::string> opt_path)
|
||||
std::string map_parser::ensure_relative_to_xml(boost::optional<std::string> const& opt_path)
|
||||
{
|
||||
if (marker_cache::instance().is_uri(*opt_path))
|
||||
return *opt_path;
|
||||
|
|
|
@ -40,9 +40,9 @@ def test_render_with_palette():
|
|||
# test saving to a string
|
||||
open('/tmp/mapnik-palette-test2.png','wb').write(im.tostring('png',palette));
|
||||
# compare the two methods
|
||||
eq_(mapnik.Image.open('/tmp/mapnik-palette-test.png').tostring(),mapnik.Image.open('/tmp/mapnik-palette-test2.png').tostring())
|
||||
eq_(mapnik.Image.open('/tmp/mapnik-palette-test.png').tostring(),mapnik.Image.open('/tmp/mapnik-palette-test2.png').tostring(),'%s not eq to %s' % ('/tmp/mapnik-palette-test.png','/tmp/mapnik-palette-test2.png'))
|
||||
# compare to expected
|
||||
eq_(mapnik.Image.open('/tmp/mapnik-palette-test.png').tostring(),mapnik.Image.open('./images/support/mapnik-palette-test.png').tostring())
|
||||
eq_(mapnik.Image.open('/tmp/mapnik-palette-test.png').tostring(),mapnik.Image.open('./images/support/mapnik-palette-test.png').tostring(),'%s not eq to %s' % ('/tmp/mapnik-palette-test.png','./images/support/mapnik-palette-test.png'))
|
||||
|
||||
if __name__ == "__main__":
|
||||
setup()
|
||||
|
|
Loading…
Reference in a new issue