+ preserve previously set alpha channel in

stroke/fill assignment so constructs like :
     style="fill-opacity:0.5;fill:blue"
  work with current svg attributes implementation
This commit is contained in:
Artem Pavlenko 2010-06-10 14:12:03 +00:00
parent 4dcef9d1a3
commit cc7e803b9d

View file

@ -194,14 +194,18 @@ public:
void fill(const agg::rgba8& f)
{
path_attributes& attr = cur_attr();
double a = attr.fill_color.opacity();
attr.fill_color = f;
attr.fill_color.opacity(a * f.opacity());
attr.fill_flag = true;
}
void stroke(const agg::rgba8& s)
{
path_attributes& attr = cur_attr();
double a = attr.stroke_color.opacity();
attr.stroke_color = s;
attr.stroke_color.opacity(a * s.opacity());
attr.stroke_flag = true;
}