bool
Circle::ImportParameters(const String ¶m, const ValueBase &value)
{
- IMPORT(color);
+ IMPORT_PLUS(color, { if (color.get_a() == 0) if (converted_blend_) {
+ set_blend_method(Color::BLEND_ALPHA_OVER);
+ color.set_a(1); } else transparent_color_ = true; });
IMPORT(radius);
IMPORT(feather);
IMPORT(invert);
bool
Rectangle::set_param(const String & param, const ValueBase &value)
{
- IMPORT(color);
+ IMPORT_PLUS(color, { if (color.get_a() == 0) if (converted_blend_) {
+ set_blend_method(Color::BLEND_ALPHA_OVER);
+ color.set_a(1); } else transparent_color_ = true; });
IMPORT(point1);
IMPORT(point2);
IMPORT(expand);
warning("loaded a version %s canvas with a 'Straight' blended PasteCanvas (%s) - check it renders OK",
version.c_str(), get_non_empty_description().c_str());
else
+ {
blend_method_ = Color::BLEND_COMPOSITE;
+ converted_blend_ = true;
+
+ // if this layer has a transparent color, go back and set the color again
+ // now that we know we are converting the blend method as well. that will
+ // make the color non-transparent, and change the blend method to alpha over
+ if (transparent_color_)
+ set_param("color", get_param("color"));
+ }
}
}
}
Color::BlendMethod blend_method=Color::BLEND_COMPOSITE
):
amount_ (amount),
- blend_method_ (blend_method)
+ blend_method_ (blend_method),
+ converted_blend_ (false),
+ transparent_color_ (false)
{ }
+ bool converted_blend_;
+ bool transparent_color_;
+
public:
float get_amount()const { return amount_; }
bool
Layer_Shape::set_param(const String & param, const ValueBase &value)
{
- IMPORT(color);
+ IMPORT_PLUS(color, { if (color.get_a() == 0) if (converted_blend_) {
+ set_blend_method(Color::BLEND_ALPHA_OVER);
+ color.set_a(1); } else transparent_color_ = true; });
IMPORT(offset);
IMPORT(invert);
IMPORT(antialias);