When the user moves a canvas' time slider, update the time sliders of any open child...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 2 Oct 2007 13:04:55 +0000 (13:04 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 2 Oct 2007 13:04:55 +0000 (13:04 +0000)
git-svn-id: http://svn.voria.com/code@810 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/layer_pastecanvas.cpp
synfig-studio/trunk/src/synfigapp/canvasinterface.cpp

index 2dd4eb0..dc95141 100644 (file)
@@ -231,7 +231,7 @@ Layer_PasteCanvas::set_time(Context context, Time time)const
        context.set_time(time);
        if(canvas)
        {
-               canvas->set_time(time);
+               canvas->set_time(time+time_offset);
 
                bounds=(canvas->get_context().get_full_bounding_rect()-canvas->rend_desc().get_focus())*exp(zoom)+origin+canvas->rend_desc().get_focus();
        }
index 1757952..ba49e88 100644 (file)
@@ -103,7 +103,13 @@ CanvasInterface::set_time(synfig::Time x)
        }
        if(cur_time_.is_equal(x))
                return;
-       cur_time_=x;
+       get_canvas()->set_time(cur_time_=x);
+
+       // update the time in all the child canvases
+       Canvas::Children children = get_canvas()->children();
+       for (Canvas::Children::iterator iter = children.begin(); iter != children.end(); iter++)
+               if (handle<CanvasInterface> interface = get_instance()->find_canvas_interface(*iter))
+                       interface->set_time(interface->get_canvas()->get_time());
 
        signal_time_changed()();
        signal_dirty_preview()();