diff --git a/include/mapnik/grid/grid.hpp b/include/mapnik/grid/grid.hpp index 165b5ef39..298513f2c 100644 --- a/include/mapnik/grid/grid.hpp +++ b/include/mapnik/grid/grid.hpp @@ -252,7 +252,15 @@ public: for (int x = box.minx(); x < box.maxx(); ++x) { - if (row_from[x-x0] & 0xff000000) + unsigned rgba = row_from[x-x0]; +#ifdef MAPNIK_BIG_ENDIAN + unsigned a = rgba & 0xff; +#else + unsigned a = (rgba >> 24) & 0xff; +#endif + // if the pixel is more than a tenth + // opaque then burn in the feature id + if (a >= 25) { row_to[x] = id; } diff --git a/src/grid/grid_renderer.cpp b/src/grid/grid_renderer.cpp index 1c26dc548..98973b91e 100644 --- a/src/grid/grid_renderer.cpp +++ b/src/grid/grid_renderer.cpp @@ -153,7 +153,19 @@ void grid_renderer::render_marker(Feature const& feature, unsigned int step, } else { - pixmap_.set_rectangle(feature.id(), **marker.get_bitmap_data(), x, y); + image_data_32 const& data = **marker.get_bitmap_data(); + if (step == 1 && scale_factor_ == 1.0) + { + pixmap_.set_rectangle(feature.id(), data, x, y); + } + else + { + double ratio = (1.0/step); + image_data_32 target(ratio * data.width(), ratio * data.height()); + mapnik::scale_image_agg(target,data, SCALING_NEAR, + scale_factor_, 0.0, 0.0, 1.0, ratio); + pixmap_.set_rectangle(feature.id(), target, x, y); + } } pixmap_.add_feature(feature); } diff --git a/src/grid/process_point_symbolizer.cpp b/src/grid/process_point_symbolizer.cpp index 3b7e0570c..8daac7136 100644 --- a/src/grid/process_point_symbolizer.cpp +++ b/src/grid/process_point_symbolizer.cpp @@ -68,8 +68,8 @@ void grid_renderer::process(point_symbolizer const& sym, prj_trans.backward(x,y,z); t_.forward(&x,&y); - int w = (*marker)->width(); - int h = (*marker)->height(); + int w = (*marker)->width() * (1.0/pixmap_.get_step()); + int h = (*marker)->height() * (1.0/pixmap_.get_step()); int px = int(floor(x - 0.5 * w)); int py = int(floor(y - 0.5 * h));