From e83079a07bd7293547be5888af71e11e6957439d Mon Sep 17 00:00:00 2001 From: dooglus Date: Sun, 17 Feb 2008 20:43:03 +0000 Subject: [PATCH] Convert static lists entirely consisting of blinepoints into 'bline' valuenodes, not 'dynamic_list' valuenodes. This will allow outlines, plants, etc. to be directly editable as soon as they're created from the 'new layer' menu. git-svn-id: http://svn.voria.com/code@1741 1f10aa63-cdf2-0310-b900-c93c546f37ac --- .../trunk/src/synfigapp/canvasinterface.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp b/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp index 0677669..c062522 100644 --- a/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp +++ b/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp @@ -234,9 +234,27 @@ CanvasInterface::add_layer_to(synfig::String name, synfig::Canvas::Handle canvas { ValueNode::Handle value_node; - // if we find any which are list values then make them into dynamic list valuenodes + // if we find any which are list values then make them + // into dynamic list valuenodes, unless every element of + // the list is a blinepoint, in which case convert it to a + // bline if(iter->second.get_type()==ValueBase::TYPE_LIST) - value_node=LinkableValueNode::create("dynamic_list",iter->second); + { + // check whether it's a list of blinepoints only + vector list(iter->second.get_list()); + if (list.size()) + { + vector::iterator iter2; + for (iter2 = list.begin(); iter2 != list.end(); iter2++) + if (iter2->get_type() != ValueBase::TYPE_BLINEPOINT) + break; + if (iter2 == list.end()) + value_node=LinkableValueNode::create("bline",iter->second); + } + + if (!value_node) + value_node=LinkableValueNode::create("dynamic_list",iter->second); + } // otherwise, if it's a type that can be converted to // 'composite' (other than the types that can be radial // composite) then do so -- 2.7.4