projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't show timing information for calls to LayerGroupTreeStore::rebuild() and LayerPa...
[synfig.git]
/
synfig-core
/
trunk
/
src
/
synfig
/
valuenode_atan2.cpp
diff --git
a/synfig-core/trunk/src/synfig/valuenode_atan2.cpp
b/synfig-core/trunk/src/synfig/valuenode_atan2.cpp
index
dc63017
..
a2e5dcc
100644
(file)
--- a/
synfig-core/trunk/src/synfig/valuenode_atan2.cpp
+++ b/
synfig-core/trunk/src/synfig/valuenode_atan2.cpp
@@
-1,6
+1,6
@@
/* === S Y N F I G ========================================================= */
/*! \file valuenode_atan2.cpp
/* === S Y N F I G ========================================================= */
/*! \file valuenode_atan2.cpp
-** \brief
Template File
+** \brief
Implementation of the "aTan2" valuenode conversion.
**
** $Id$
**
**
** $Id$
**
@@
-60,7
+60,7
@@
ValueNode_Atan2::ValueNode_Atan2(const ValueBase &value):
set_link("y",ValueNode_Const::create(Angle::sin(value.get(Angle())).get()));
break;
default:
set_link("y",ValueNode_Const::create(Angle::sin(value.get(Angle())).get()));
break;
default:
- throw Exception::BadType(ValueBase::type_name(value.get_type()));
+ throw Exception::BadType(ValueBase::type_
local_
name(value.get_type()));
}
DCAST_HACK_ENABLE();
}
DCAST_HACK_ENABLE();
@@
-110,20
+110,14
@@
ValueNode_Atan2::check_type(ValueBase::Type type)
}
bool
}
bool
-ValueNode_Atan2::set_link_vfunc(int i,ValueNode::Handle
x
)
+ValueNode_Atan2::set_link_vfunc(int i,ValueNode::Handle
value
)
{
{
- assert(i==0 || i==1);
- if(i==0)
- {
- x_=x;
- signal_child_changed()(i);signal_value_changed()();
- return true;
- }
- if(i==1)
+ assert(i>=0 && i<link_count());
+
+ switch(i)
{
{
- y_=x;
- signal_child_changed()(i);signal_value_changed()();
- return true;
+ case 0: CHECK_TYPE_AND_SET_VALUE(x_, ValueBase::TYPE_REAL);
+ case 1: CHECK_TYPE_AND_SET_VALUE(y_, ValueBase::TYPE_REAL);
}
return false;
}
}
return false;
}
@@
-131,7
+125,8
@@
ValueNode_Atan2::set_link_vfunc(int i,ValueNode::Handle x)
ValueNode::LooseHandle
ValueNode_Atan2::get_link_vfunc(int i)const
{
ValueNode::LooseHandle
ValueNode_Atan2::get_link_vfunc(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return x_;
if(i==1)
if(i==0)
return x_;
if(i==1)
@@
-149,7
+144,8
@@
ValueNode_Atan2::link_count()const
String
ValueNode_Atan2::link_name(int i)const
{
String
ValueNode_Atan2::link_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return "x";
if(i==1)
if(i==0)
return "x";
if(i==1)
@@
-160,7
+156,8
@@
ValueNode_Atan2::link_name(int i)const
String
ValueNode_Atan2::link_local_name(int i)const
{
String
ValueNode_Atan2::link_local_name(int i)const
{
- assert(i==0 || i==1);
+ assert(i>=0 && i<link_count());
+
if(i==0)
return _("X");
if(i==1)
if(i==0)
return _("X");
if(i==1)