Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix handling of premultiplication in svg rendering - refs #1262

  • Loading branch information...
commit f60d85e2e77124896ca359df37c2dda77b80aaf8 1 parent 48a543b
@springmeyer springmeyer authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 include/mapnik/svg/svg_renderer.hpp
View
4 include/mapnik/svg/svg_renderer.hpp
@@ -147,7 +147,7 @@ class svg_renderer : boost::noncopyable
unsigned b = stop_color.blue();
unsigned a = stop_color.alpha();
//MAPNIK_LOG_DEBUG(svg_renderer) << "svg_renderer: r=" << r << ",g=" << g << ",b=" << b << ",a=" << a;
- m_gradient_lut.add_color(st.first, agg::rgba8(r, g, b, int(a * opacity)));
+ m_gradient_lut.add_color(st.first, agg::rgba8_pre(r, g, b, int(a * opacity)));
}
m_gradient_lut.build_lut();
@@ -300,6 +300,7 @@ class svg_renderer : boost::noncopyable
color = attr.fill_color;
color.opacity(color.opacity() * attr.opacity * opacity);
ScanlineRenderer ren_s(ren);
+ color.premultiply();
ren_s.color(color);
render_scanlines(ras, sl, ren_s);
}
@@ -335,6 +336,7 @@ class svg_renderer : boost::noncopyable
color = attr.stroke_color;
color.opacity(color.opacity() * attr.opacity * opacity);
ScanlineRenderer ren_s(ren);
+ color.premultiply();
ren_s.color(color);
render_scanlines(ras, sl, ren_s);
}
Please sign in to comment.
Something went wrong with that request. Please try again.