X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fwidget_timeslider.cpp;h=24241cb4502346ef5e8a1cc2b4b701e9704094a7;hb=c3ad95144d148602f672e95ddda1f18fc35502f8;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..24241cb 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; } @@ -399,7 +402,7 @@ void Widget_Timeslider::refresh() } }*/ -bool Widget_Timeslider::redraw(bool doublebuffer) +bool Widget_Timeslider::redraw(bool /*doublebuffer*/) { Glib::RefPtr window = get_window(); @@ -491,7 +494,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 +502,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;