+ apply opacity and text-opacity

This commit is contained in:
Artem Pavlenko 2010-06-15 12:28:06 +00:00
parent d69dfe6656
commit f7fe6dbf15
2 changed files with 5 additions and 3 deletions

View file

@ -96,7 +96,7 @@ void agg_renderer<T>::process(markers_symbolizer const& sym,
while (placement.get_point(&x, &y, &angle)) while (placement.get_point(&x, &y, &angle))
{ {
agg::trans_affine matrix = tr *agg::trans_affine_rotation(angle) * agg::trans_affine_translation(x, y); agg::trans_affine matrix = tr *agg::trans_affine_rotation(angle) * agg::trans_affine_translation(x, y);
svg_renderer.render(*ras_ptr, sl, ren, matrix, renb.clip_box(), 1.0 /*sym.get_opacity()*/); svg_renderer.render(*ras_ptr, sl, ren, matrix, renb.clip_box(), sym.get_opacity());
} }
} }
} }

View file

@ -125,6 +125,7 @@ void agg_renderer<T>::process(shield_symbolizer const& sym,
text_ren.set_fill(sym.get_fill()); text_ren.set_fill(sym.get_fill());
text_ren.set_halo_fill(sym.get_halo_fill()); text_ren.set_halo_fill(sym.get_halo_fill());
text_ren.set_halo_radius(sym.get_halo_radius()); text_ren.set_halo_radius(sym.get_halo_radius());
text_ren.set_opacity(sym.get_text_opacity());
placement_finder<label_collision_detector4> finder(detector_); placement_finder<label_collision_detector4> finder(detector_);
@ -262,7 +263,8 @@ void agg_renderer<T>::process(shield_symbolizer const& sym,
ren.set_fill(sym.get_fill()); ren.set_fill(sym.get_fill());
ren.set_halo_fill(sym.get_halo_fill()); ren.set_halo_fill(sym.get_halo_fill());
ren.set_halo_radius(sym.get_halo_radius()); ren.set_halo_radius(sym.get_halo_radius());
ren.set_opacity(sym.get_text_opacity());
placement_finder<label_collision_detector4> finder(detector_); placement_finder<label_collision_detector4> finder(detector_);
string_info info(text); string_info info(text);
@ -333,7 +335,7 @@ void agg_renderer<T>::process(shield_symbolizer const& sym,
if ( sym.get_allow_overlap() || detector_.has_placement(label_ext) ) if ( sym.get_allow_overlap() || detector_.has_placement(label_ext) )
{ {
//pixmap_.set_rectangle_alpha(px,py,*data); //pixmap_.set_rectangle_alpha(px,py,*data);
pixmap_.set_rectangle_alpha2(*(*data),px,py,float(sym.get_opacity())); pixmap_.set_rectangle_alpha2(*(*data),px,py,sym.get_opacity());
box2d<double> dim = ren.prepare_glyphs(&text_placement.placements[0]); box2d<double> dim = ren.prepare_glyphs(&text_placement.placements[0]);
ren.render(x,y); ren.render(x,y);
detector_.insert(label_ext); detector_.insert(label_ext);