From: Carlos Lopez Date: Sun, 28 Nov 2010 09:07:07 +0000 (+0100) Subject: Fix bug: fps rounding to integer - ID: 3104763 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e141439cbbdfbd8c711386d988d398bb2f2ee47a;p=synfig.git Fix bug: fps rounding to integer - ID: 3104763 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. --- diff --git a/synfig-studio/src/gui/docks/dock_timetrack.cpp b/synfig-studio/src/gui/docks/dock_timetrack.cpp index adb8998..9d10032 100644 --- a/synfig-studio/src/gui/docks/dock_timetrack.cpp +++ b/synfig-studio/src/gui/docks/dock_timetrack.cpp @@ -419,6 +419,7 @@ Dock_Timetrack::init_canvas_view_vfunc(etl::loose_handle 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 canvas_view) { if(table_) diff --git a/synfig-studio/src/gui/docks/dock_timetrack.h b/synfig-studio/src/gui/docks/dock_timetrack.h index 5525ee6..27406c4 100644 --- a/synfig-studio/src/gui/docks/dock_timetrack.h +++ b/synfig-studio/src/gui/docks/dock_timetrack.h @@ -56,6 +56,7 @@ protected: virtual void changed_canvas_view_vfunc(etl::loose_handle canvas_view); void refresh_selected_param(); + void refresh_rend_desc(); public: diff --git a/synfig-studio/src/gui/renddesc.cpp b/synfig-studio/src/gui/renddesc.cpp index c88ac87..f67e603 100644 --- a/synfig-studio/src/gui/renddesc.cpp +++ b/synfig-studio/src/gui/renddesc.cpp @@ -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()(); }