Setting the 'In Interpolation' of a waypoint to 'Constant' causes the left hand side...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 24 Mar 2007 17:37:05 +0000 (17:37 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 24 Mar 2007 17:37:05 +0000 (17:37 +0000)
git-svn-id: http://svn.voria.com/code@380 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/widget_timeslider.cpp

index a0d0a84..d350d4a 100644 (file)
@@ -87,11 +87,14 @@ Gdk::Color get_interp_color(synfig::Interpolation x)
 static Gdk::Color
 color_darken(Gdk::Color x, float amount)
 {
-       x.set_rgb_p(
-               x.get_red_p()*amount,
-               x.get_green_p()*amount,
-               x.get_blue_p()*amount
-       );
+       double   red = x.get_red_p()   * amount;
+       double green = x.get_green_p() * amount;
+       double  blue = x.get_blue_p()  * amount;
+
+       x.set_rgb_p(  red > 1 ? 1 : red,
+                               green > 1 ? 1 : green,
+                                blue > 1 ? 1 : blue);
+
        return x;
 }