Change the tooltip "Zoom Fit" -> "Zoom to Fit".
[synfig.git] / synfig-studio / trunk / src / synfigapp / canvasinterface.cpp
index c062522..6619719 100644 (file)
@@ -41,6 +41,7 @@
 #include <synfig/valuenode_reference.h>
 #include <synfig/valuenode_twotone.h>
 #include <synfig/valuenode_stripes.h>
+#include <synfig/valuenode_bline.h>
 
 #include <synfig/waypoint.h>
 #include <synfig/loadcanvas.h>
@@ -249,7 +250,10 @@ CanvasInterface::add_layer_to(synfig::String name, synfig::Canvas::Handle canvas
                                                if (iter2->get_type() != ValueBase::TYPE_BLINEPOINT)
                                                        break;
                                        if (iter2 == list.end())
+                                       {
                                                value_node=LinkableValueNode::create("bline",iter->second);
+                                               ValueNode_BLine::Handle::cast_dynamic(value_node)->set_member_canvas(canvas);
+                                       }
                                }
 
                                if (!value_node)
@@ -749,19 +753,22 @@ CanvasInterface::change_value(synfigapp::ValueDesc value_desc,synfig::ValueBase
                return true;
 
        // If this change needs to take place elsewhere, then so be it.
-       if(value_desc.get_canvas() && value_desc.get_canvas()->get_root()!=get_canvas()->get_root())do
+       if(value_desc.get_canvas())
        {
-               etl::handle<Instance> instance;
-               instance=find_instance(value_desc.get_canvas()->get_root());
-
-               if(instance)
-                       return instance->find_canvas_interface(value_desc.get_canvas())->change_value(value_desc,new_value);
-               else
+               if (value_desc.get_canvas()->get_root() != get_canvas()->get_root())
                {
-                       get_ui_interface()->error(_("The value you are trying to edit is in a composition\nwhich doesn't seem to be open. Open that composition and you\nshould be able to edit this value as normal."));
-                       return false;
+                       etl::handle<Instance> instance;
+                       instance=find_instance(value_desc.get_canvas()->get_root());
+
+                       if(instance)
+                               return instance->find_canvas_interface(value_desc.get_canvas())->change_value(value_desc,new_value);
+                       else
+                       {
+                               get_ui_interface()->error(_("The value you are trying to edit is in a composition\nwhich doesn't seem to be open. Open that composition and you\nshould be able to edit this value as normal."));
+                               return false;
+                       }
                }
-       }while(0);
+       }
 #ifdef _DEBUG
        else
        { synfig::warning("Can't get canvas from value desc...?"); }