**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
-** Copyright (c) 2008 Chris Moore
+** Copyright (c) 2007, 2008 Chris Moore
+** Copyright (c) 2009 Nikita Kitaev
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
#include <gtkmm/entry.h>
#include <synfig/valuenode_animated.h>
+#include <synfig/valuenode_blinecalcvertex.h>
#include <synfig/valuenode_composite.h>
#include <synfig/valuenode_const.h>
#include <synfig/valuenode_dynamiclist.h>
etl::handle<CanvasView> canvas_view_;
bool scale;
bool rotate;
- bool constrain;
+ bool constrain;
DuckDrag_Combo();
void begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& begin);
bool end_duck_drag(Duckmatic* duckmatic);
if((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION)
(*iter)->set_trans_point(positions[i]+vect, time);
}
- DuckList duck_list(duckmatic->get_duck_list());
- for (iter=duck_list.begin(); iter!=duck_list.end(); ++iter)
- {
- if ((*iter)->get_type() == Duck::TYPE_TANGENT || (*iter)->get_type() == Duck::TYPE_WIDTH)
- {
- (*iter)->update(time);
- }
- }
- return;
}
if (rotate)
(*iter)->set_trans_point(p, time);
}
}
+
+ // then patch up the tangents for the vertices we've moved
+ DuckList duck_list(duckmatic->get_duck_list());
+ for (iter=selected_ducks.begin(); iter!=selected_ducks.end(); ++iter)
+ {
+ etl::handle<Duck> duck(*iter);
+ if (duck->get_type() == Duck::TYPE_VERTEX || duck->get_type() == Duck::TYPE_POSITION)
+ {
+ ValueNode_Composite::Handle composite;
+
+ if ((ValueNode_BLineCalcVertex::Handle::cast_dynamic(duck->get_value_desc().get_value_node())) ||
+ ((composite = ValueNode_Composite::Handle::cast_dynamic(duck->get_value_desc().get_value_node())) &&
+ composite->get_type() == ValueBase::TYPE_BLINEPOINT &&
+ (ValueNode_BLineCalcVertex::Handle::cast_dynamic(composite->get_link("point")))))
+ {
+ //! \todo update() will call dynamic cast again, see if we can avoid that
+ DuckList::iterator iter;
+ for (iter=duck_list.begin(); iter!=duck_list.end(); iter++)
+ if ((*iter)->get_origin_duck()==duck
+ && std::find(selected_ducks.begin(),
+ selected_ducks.end(), *iter) == selected_ducks.end())
+ (*iter)->update(time);
+ }
+ }
+ }
+
last_move=vect;
}