From bee09477a805dea7ef19b17e1b011cbb2e58404e Mon Sep 17 00:00:00 2001 From: artemp Date: Tue, 14 Aug 2012 17:14:30 +0100 Subject: [PATCH] + cairo : fix shield scaling --- src/cairo_renderer.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/cairo_renderer.cpp b/src/cairo_renderer.cpp index cfe8f174c..398e095f6 100644 --- a/src/cairo_renderer.cpp +++ b/src/cairo_renderer.cpp @@ -1162,7 +1162,9 @@ void cairo_renderer_base::render_marker(pixel_position const& pos, marker const& } else if (marker.is_bitmap()) { - context.add_image(pos.x, pos.y, **marker.get_bitmap_data(), opacity); + agg::trans_affine matrix = tr; + matrix *= agg::trans_affine_translation(pos.x, pos.y); + context.add_image(matrix, **marker.get_bitmap_data(), opacity); } } @@ -1239,9 +1241,17 @@ void cairo_renderer_base::process(shield_symbolizer const& sym, for (unsigned int ii = 0; ii < placements.size(); ++ii) { pixel_position marker_pos = helper.get_marker_position(placements[ii]); + double dx = 0.5 * helper.get_marker_width(); + double dy = 0.5 * helper.get_marker_height(); + agg::trans_affine marker_tr = agg::trans_affine_translation(-dx,-dy); + marker_tr *= agg::trans_affine_scaling(scale_factor_); + marker_tr *= agg::trans_affine_translation(dx,dy); + marker_tr *= helper.get_image_transform(); render_marker(marker_pos, - helper.get_marker(), helper.get_image_transform(), + helper.get_marker(), + marker_tr, sym.get_opacity()); + context.add_text(placements[ii], face_manager_, font_manager_, scale_factor_); } }