Author: Carlos Lopez <genet...@gmail.com>
Date:   Sun Apr 14 18:05:26 2013 +0200

Fix blend method MULTIPLY for CairoColor.

---

 synfig-core/src/synfig/color.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index bad7724..e08f322 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -631,7 +631,7 @@ CairoColor
 blendfunc_MULTIPLY(CairoColor &a,CairoColor &b, float amount)
 {
        if(amount<0) a=~a, amount=-amount;
-       amount*=a.get_a()/255;
+       amount*=a.get_a()/255.0;
        int ra, ga, ba;
        int rb, gb, bb;
 
@@ -643,9 +643,9 @@ blendfunc_MULTIPLY(CairoColor &a,CairoColor &b, float 
amount)
        gb=b.get_g();
        bb=b.get_b();
        
-       b.set_r((rb*ra/255-rb)*(amount)+rb);
-       b.set_g((gb*ga/255-gb)*(amount)+gb);
-       b.set_b((bb*ba/255-bb)*(amount)+bb);
+       b.set_r((rb*ra*amount/255.0)+rb*(1.0-amount));
+       b.set_g((gb*ga*amount/255.0)+gb*(1.0-amount));
+       b.set_b((bb*ba*amount/255.0)+bb*(1.0-amount));
        return b;
 }
 


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to