Merge remote-tracking branch 'origin'

This commit is contained in:
artemp 2012-07-30 18:35:03 +01:00
commit b963b6c2b3
6 changed files with 25 additions and 22 deletions

View file

@ -32,6 +32,10 @@ try:
except:
HAS_DISTUTILS = False
if platform.uname()[4] == 'ppc64':
LIBDIR_SCHEMA='lib64'
else:
LIBDIR_SCHEMA='lib'
py3 = None
@ -237,14 +241,6 @@ def sort_paths(items,priority):
new.extend(v)
return new
if platform.dist()[0] in ('Ubuntu','debian'):
LIBDIR_SCHEMA='lib'
elif platform.uname()[4] == 'ppc64':
LIBDIR_SCHEMA='lib64'
else:
LIBDIR_SCHEMA='lib'
def pretty_dep(dep):
pretty = pretty_dep_names.get(dep)
if pretty:

View file

@ -44,18 +44,15 @@ bool push_explicit_style(Attr const& src, Attr & dst, markers_symbolizer const&
{
mapnik::svg::path_attributes attr = src[i];
if (strk)
if (strk && attr.stroke_flag)
{
attr.stroke_flag = true;
attr.stroke_width = strk->get_width();
color const& s_color = strk->get_color();
attr.stroke_color = agg::rgba(s_color.red()/255.0,s_color.green()/255.0,
s_color.blue()/255.0,(s_color.alpha()*strk->get_opacity())/255.0);
}
if (fill)
if (fill && attr.fill_flag)
{
attr.fill_flag = true;
color const& f_color = *fill;
attr.fill_color = agg::rgba(f_color.red()/255.0,f_color.green()/255.0,
f_color.blue()/255.0,(f_color.alpha()*sym.get_opacity())/255.0);

View file

@ -111,7 +111,7 @@ private:
void parse_markers_symbolizer(rule & rule, xml_node const& sym);
void parse_raster_colorizer(raster_colorizer_ptr const& rc, xml_node const& node);
void parse_stroke(stroke & strk, xml_node const & sym);
bool parse_stroke(stroke & strk, xml_node const & sym);
void ensure_font_face(std::string const& face_name);
void find_unused_nodes(xml_node const& root);
@ -1055,8 +1055,10 @@ void map_parser::parse_markers_symbolizer(rule & rule, xml_node const& node)
if (height) sym.set_height(*height);
stroke strk;
parse_stroke(strk,node);
sym.set_stroke(strk);
if (parse_stroke(strk,node))
{
sym.set_stroke(strk);
}
marker_placement_e placement = node.get_attr<marker_placement_e>("placement", MARKER_POINT_PLACEMENT);
sym.set_marker_placement(placement);
@ -1300,12 +1302,15 @@ void map_parser::parse_shield_symbolizer(rule & rule, xml_node const& sym)
}
}
void map_parser::parse_stroke(stroke & strk, xml_node const & sym)
bool map_parser::parse_stroke(stroke & strk, xml_node const & sym)
{
bool result = false;
// stroke color
optional<color> c = sym.get_opt_attr<color>("stroke");
if (c)
{
result = true;
strk.set_color(*c);
}
@ -1313,12 +1318,17 @@ void map_parser::parse_stroke(stroke & strk, xml_node const & sym)
optional<double> width = sym.get_opt_attr<double>("stroke-width");
if (width)
{
result = true;
strk.set_width(*width);
}
// stroke-opacity
optional<double> opacity = sym.get_opt_attr<double>("stroke-opacity");
if (opacity) strk.set_opacity(*opacity);
if (opacity)
{
result = true;
strk.set_opacity(*opacity);
}
// stroke-linejoin
optional<line_join_e> line_join = sym.get_opt_attr<line_join_e>("stroke-linejoin");
@ -1373,6 +1383,7 @@ void map_parser::parse_stroke(stroke & strk, xml_node const & sym)
// stroke-miterlimit
optional<double> miterlimit = sym.get_opt_attr<double>("stroke-miterlimit");
if (miterlimit) strk.set_miterlimit(*miterlimit);
return result;
}
void map_parser::parse_line_symbolizer(rule & rule, xml_node const & sym)

View file

@ -59,7 +59,7 @@ marker_cache::marker_cache()
insert_svg("arrow",
"<?xml version='1.0' standalone='no'?>"
"<svg width='100%' height='100%' version='1.1' xmlns='http://www.w3.org/2000/svg'>"
"<path fill='#93a7ac' d='m 31.698405,7.5302648 -8.910967,-6.0263712 0.594993,4.8210971 -18.9822542,0 0,2.4105482 18.9822542,0 -0.594993,4.8210971 z'/>"
"<path fill='#0000FF' stroke='black' stroke-width='.5' d='m 31.698405,7.5302648 -8.910967,-6.0263712 0.594993,4.8210971 -18.9822542,0 0,2.4105482 18.9822542,0 -0.594993,4.8210971 z'/>"
"</svg>");
}

View file

@ -12,7 +12,6 @@ passed = 0
def compare_pixels(pixel1, pixel2):
if pixel1 == pixel2:
return False
# will only work on little endian
r_diff = abs((pixel1 & 0xff) - (pixel2 & 0xff))
g_diff = abs(((pixel1 >> 8) & 0xff) - ((pixel2 >> 8) & 0xff))
b_diff = abs(((pixel1 >> 16) & 0xff)- ((pixel2 >> 16) & 0xff))
@ -32,7 +31,7 @@ def compare(actual, expected):
im1 = mapnik.Image.open(actual)
try:
im2 = mapnik.Image.open(expected)
except IOError:
except RuntimeError:
errors.append((None, actual, expected))
return -1
diff = 0

View file

@ -81,7 +81,7 @@ if __name__ == "__main__":
files = [{"name": sys.argv[1], "sizes": sizes_few_square}]
elif len(sys.argv) > 2:
files = []
for name in argv[1:]:
for name in sys.argv[1:]:
files.append({"name": name})
for f in files: