X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fwidget_timeslider.cpp;h=26f40cc6ec64f8bd1406db9d86c8fce0a788761d;hb=37600b4b217caa5e316984ec0b035c5e8f9698af;hp=a0d0a842cf1f2d8022279c4bc64cea323db7dc12;hpb=837b63e9fb829d66d43f4f169861f8979f76820d;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/widget_timeslider.cpp b/synfig-studio/trunk/src/gtkmm/widget_timeslider.cpp index a0d0a84..26f40cc 100644 --- a/synfig-studio/trunk/src/gtkmm/widget_timeslider.cpp +++ b/synfig-studio/trunk/src/gtkmm/widget_timeslider.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2004 Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -87,11 +88,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; } @@ -308,7 +312,7 @@ studio::render_time_point_to_window( /* === M E T H O D S ======================================================= */ /* === E N T R Y P O I N T ================================================= */ -double defaultfps = 0; +double defaultfps = 24; const int fullheight = 20; Widget_Timeslider::Widget_Timeslider() @@ -399,7 +403,7 @@ void Widget_Timeslider::refresh() } }*/ -bool Widget_Timeslider::redraw(bool doublebuffer) +bool Widget_Timeslider::redraw(bool /*doublebuffer*/) { Glib::RefPtr window = get_window(); @@ -491,7 +495,7 @@ bool Widget_Timeslider::redraw(bool doublebuffer) //search around this area to get the right one - //get first valid line and it's position in pixel space + //get first valid line and its position in pixel space double time = 0; double pixel = 0; @@ -499,7 +503,7 @@ bool Widget_Timeslider::redraw(bool doublebuffer) double subr = scale / subdiv; - //get it's position inside... + //get its position inside... time = ceil(start/subr)*subr - start; pixel = time*dpdt;