Fix bug: fps rounding to integer - ID: 3104763
authorCarlos Lopez <genetita@gmail.com>
Sun, 28 Nov 2010 09:07:07 +0000 (10:07 +0100)
committerCarlos Lopez <genetita@gmail.com>
Sun, 28 Nov 2010 09:07:07 +0000 (10:07 +0100)
Also fixed that widget time slider frames per second was not updated when changing the render description.
It produced bad time cursor position when dragging the time cursor and the document fps is not 24 fps (the default one for widget time slider)
Now when the render description is modified, the sock time track widget time slider fps is updated.

synfig-studio/src/gui/docks/dock_timetrack.cpp
synfig-studio/src/gui/docks/dock_timetrack.h
synfig-studio/src/gui/renddesc.cpp

index adb8998..9d10032 100644 (file)
@@ -419,6 +419,7 @@ Dock_Timetrack::init_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view
        canvas_view->time_adjustment().signal_changed().connect(sigc::mem_fun(*tree_view,&Gtk::TreeView::queue_draw));
 
        canvas_view->set_ext_widget(get_name(),tree_view);
+       canvas_view->canvas_interface()->signal_rend_desc_changed().connect(sigc::mem_fun(*this,&studio::Dock_Timetrack::refresh_rend_desc));
 }
 
 void
@@ -444,6 +445,15 @@ Dock_Timetrack::refresh_selected_param()
 }
 
 void
+Dock_Timetrack::refresh_rend_desc()
+{
+       if(App::get_selected_canvas_view())
+       {
+               widget_timeslider_->set_global_fps(App::get_selected_canvas_view()->get_canvas()->rend_desc().get_frame_rate());
+       }
+}
+
+void
 Dock_Timetrack::changed_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
 {
        if(table_)
index 5525ee6..27406c4 100644 (file)
@@ -56,6 +56,7 @@ protected:
        virtual void changed_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view);
 
        void refresh_selected_param();
+       void refresh_rend_desc();
 
 public:
 
index c88ac87..f67e603 100644 (file)
@@ -290,7 +290,7 @@ Widget_RendDesc::on_fps_changed()
 {
        if(update_lock)return;
        UpdateLock lock(update_lock);
-       rend_desc_.set_frame_rate((int)(adjustment_fps.get_value()+0.5));
+       rend_desc_.set_frame_rate(adjustment_fps.get_value());
        refresh();
        signal_changed()();
 }