From: dooglus Date: Sat, 31 Mar 2007 22:11:13 +0000 (+0000) Subject: Rectangles are 'solid color' when using straight blending if both the amount and... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6046b358f5cc710d4318f2492a848eecdd854999;p=synfig.git Rectangles are 'solid color' when using straight blending if both the amount and the color's alpha are 1.0. git-svn-id: http://svn.voria.com/code@401 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/modules/mod_geometry/rectangle.cpp b/synfig-core/trunk/src/modules/mod_geometry/rectangle.cpp index d5b861c..799a0f6 100644 --- a/synfig-core/trunk/src/modules/mod_geometry/rectangle.cpp +++ b/synfig-core/trunk/src/modules/mod_geometry/rectangle.cpp @@ -177,6 +177,15 @@ Rectangle::hit_check(synfig::Context context, const synfig::Point &pos)const return context.hit_check(pos); } +bool +Rectangle::is_solid_color()const +{ + return Layer_Composite::is_solid_color() || + (get_blend_method() == Color::BLEND_COMPOSITE && + get_amount() == 1.0f && + color.get_a() == 1.0f); +} + Color Rectangle::get_color(Context context, const Point &pos)const { diff --git a/synfig-core/trunk/src/synfig/layer_composite.h b/synfig-core/trunk/src/synfig/layer_composite.h index 2dcac68..d7d47a1 100644 --- a/synfig-core/trunk/src/synfig/layer_composite.h +++ b/synfig-core/trunk/src/synfig/layer_composite.h @@ -72,7 +72,7 @@ public: Layer_Composite& set_blend_method(Color::BlendMethod x) { blend_method_=x; return *this; } - bool is_solid_color()const { return amount_==1.0f && blend_method_==Color::BLEND_STRAIGHT; } + virtual bool is_solid_color()const { return amount_==1.0f && blend_method_==Color::BLEND_STRAIGHT; } bool is_disabled()const { return amount_==0.0f; }