From: dooglus Date: Sat, 24 Mar 2007 17:37:05 +0000 (+0000) Subject: Setting the 'In Interpolation' of a waypoint to 'Constant' causes the left hand side... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=700213b0555c6bba0fb82197cc18dd6322384762;p=synfig.git 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 --- 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; }