mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
refactoring following comment on pull request
This commit is contained in:
parent
85a55d9fa2
commit
b438a56ada
@ -213,12 +213,12 @@ struct symbolizer_attributes : public boost::static_visitor<>
|
||||
|
||||
void operator () (building_symbolizer const& sym)
|
||||
{
|
||||
expression_ptr const& height_expr = sym.height();
|
||||
if (height_expr)
|
||||
{
|
||||
expression_attributes f_attr(names_);
|
||||
boost::apply_visitor(f_attr,*height_expr);
|
||||
}
|
||||
expression_ptr const& height_expr = sym.height();
|
||||
if (height_expr)
|
||||
{
|
||||
expression_attributes f_attr(names_);
|
||||
boost::apply_visitor(f_attr,*height_expr);
|
||||
}
|
||||
collect_metawriter(sym);
|
||||
}
|
||||
// TODO - support remaining syms
|
||||
|
||||
@ -71,8 +71,8 @@ void agg_renderer<T>::process(building_symbolizer const& sym,
|
||||
expression_ptr height_expr = sym.height();
|
||||
if (height_expr)
|
||||
{
|
||||
value_type result = boost::apply_visitor(evaluate<Feature,value_type>(feature), *height_expr);
|
||||
height = result.to_double() * scale_factor_;
|
||||
value_type result = boost::apply_visitor(evaluate<Feature,value_type>(feature), *height_expr);
|
||||
height = result.to_double() * scale_factor_;
|
||||
}
|
||||
|
||||
for (unsigned i=0;i<feature.num_geometries();++i)
|
||||
|
||||
@ -780,12 +780,12 @@ void cairo_renderer_base::process(building_symbolizer const& sym,
|
||||
|
||||
color const& fill = sym.get_fill();
|
||||
double height = 0.0;
|
||||
expression_ptr height_expr = sym.height();
|
||||
if (height_expr)
|
||||
{
|
||||
value_type result = boost::apply_visitor(evaluate<Feature,value_type>(feature), *height_expr);
|
||||
height = 0.7071 * result.to_double();
|
||||
}
|
||||
expression_ptr height_expr = sym.height();
|
||||
if (height_expr)
|
||||
{
|
||||
value_type result = boost::apply_visitor(evaluate<Feature,value_type>(feature), *height_expr);
|
||||
height = 0.7071 * result.to_double();
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < feature.num_geometries(); ++i)
|
||||
{
|
||||
|
||||
@ -241,10 +241,9 @@ public:
|
||||
{
|
||||
set_attr( sym_node, "fill-opacity", sym.get_opacity() );
|
||||
}
|
||||
if ( sym.height() != dfl.height() || explicit_defaults_ )
|
||||
{
|
||||
set_attr( sym_node, "height", sym.height() );
|
||||
}
|
||||
|
||||
set_attr( sym_node, "height", to_expression_string(*sym.height()) );
|
||||
|
||||
add_metawriter_attributes(sym_node, sym);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user