Rectangles are 'solid color' when using straight blending if both the amount and...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 31 Mar 2007 22:11:13 +0000 (22:11 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 31 Mar 2007 22:11:13 +0000 (22:11 +0000)
git-svn-id: http://svn.voria.com/code@401 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/modules/mod_geometry/rectangle.cpp
synfig-core/trunk/src/synfig/layer_composite.h

index d5b861c..799a0f6 100644 (file)
@@ -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
 {
index 2dcac68..d7d47a1 100644 (file)
@@ -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; }