respect text and halo opacity in cairo renderer

This commit is contained in:
artemp 2014-06-20 09:35:33 +01:00
parent bed3c5a9c1
commit f518d44be0
2 changed files with 4 additions and 4 deletions

View file

@ -66,7 +66,7 @@ void cairo_context::show_page()
check_object_status_and_throw_exception(*this);
}
void cairo_context::set_color(color const &color, double opacity)
void cairo_context::set_color(color const& color, double opacity)
{
set_color(color.red()/255.0, color.green()/255.0, color.blue()/255.0, color.alpha() * opacity / 255.0);
}
@ -469,7 +469,7 @@ void cairo_context::add_text(glyph_positions_ptr path,
glyph_path(glyph.glyph_index, pixel_position(sx + pos.x, sy - pos.y));
set_line_width(2.0 * halo_radius);
set_line_join(ROUND_JOIN);
set_color(format->halo_fill);
set_color(format->halo_fill, format->halo_opacity);
stroke();
}
@ -496,7 +496,7 @@ void cairo_context::add_text(glyph_positions_ptr path,
set_font_matrix(matrix);
set_font_face(manager, glyph.face);
pixel_position pos = glyph_pos.pos + glyph.offset.rotate(glyph_pos.rot);
set_color(format->fill);
set_color(format->fill, format->text_opacity);
show_glyph(glyph.glyph_index, pixel_position(sx + pos.x, sy - pos.y));
}

View file

@ -1010,7 +1010,7 @@ void cairo_renderer_base::process(text_symbolizer const& sym,
composite_mode_e comp_op = get<composite_mode_e>(sym, keys::comp_op, feature, common_.vars_, src_over);
context_.set_operator(comp_op);
placements_list const &placements = helper.get();
placements_list const& placements = helper.get();
for (glyph_positions_ptr glyphs : placements)
{
context_.add_text(glyphs, face_manager_, common_.font_manager_, common_.scale_factor_);