From c0293e1a2e3d68c53e2ad07bd5be9066b202771d Mon Sep 17 00:00:00 2001 From: dooglus Date: Sun, 16 Sep 2007 00:54:26 +0000 Subject: [PATCH] Multiplying a gradient by zero empties it. git-svn-id: http://svn.voria.com/code@677 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/gradient.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/synfig-core/trunk/src/synfig/gradient.cpp b/synfig-core/trunk/src/synfig/gradient.cpp index 2411006..29f3055 100644 --- a/synfig-core/trunk/src/synfig/gradient.cpp +++ b/synfig-core/trunk/src/synfig/gradient.cpp @@ -210,8 +210,11 @@ synfig::Gradient::operator-=(const Gradient &rhs) Gradient & synfig::Gradient::operator*=(const float &rhs) { - for (iterator iter = cpoints.begin(); iter!=cpoints.end(); iter++) - (*iter).color *= rhs; + if (rhs == 0) + cpoints.clear(); + else + for (iterator iter = cpoints.begin(); iter!=cpoints.end(); iter++) + (*iter).color *= rhs; return *this; } -- 2.7.4