From 700213b0555c6bba0fb82197cc18dd6322384762 Mon Sep 17 00:00:00 2001 From: dooglus Date: Sat, 24 Mar 2007 17:37:05 +0000 Subject: [PATCH] Setting the 'In Interpolation' of a waypoint to 'Constant' causes the left hand side of the waypoint to be set to colour #C70000. Then selecting that waypoint causes it to be highlighted, by multiplying the colour by 1.3. 0xc7 * 1.3 > 0x100, so the colour was wrapping around to 0 and the highlighted waypoint was appearing black. git-svn-id: http://svn.voria.com/code@380 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/widget_timeslider.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/widget_timeslider.cpp b/synfig-studio/trunk/src/gtkmm/widget_timeslider.cpp index a0d0a84..d350d4a 100644 --- a/synfig-studio/trunk/src/gtkmm/widget_timeslider.cpp +++ b/synfig-studio/trunk/src/gtkmm/widget_timeslider.cpp @@ -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; } -- 2.7.4