Keep the value the same when converting to "Dot Product".
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 9 Mar 2008 12:07:19 +0000 (12:07 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 9 Mar 2008 12:07:19 +0000 (12:07 +0000)
git-svn-id: http://svn.voria.com/code@1903 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/valuenode_dotproduct.cpp

index 20f8ae5..12a1c11 100644 (file)
@@ -56,12 +56,12 @@ ValueNode_DotProduct::ValueNode_DotProduct(const ValueBase &value):
        switch(value.get_type())
        {
        case ValueBase::TYPE_REAL:
-               set_link("lhs",ValueNode_Const::create(Vector(1,0)));
-               set_link("rhs",ValueNode_Const::create(Vector(0,1)));
+               set_link("lhs",ValueNode_Const::create(Vector(value.get(Real()),0)));
+               set_link("rhs",ValueNode_Const::create(Vector(1,0)));
                break;
        case ValueBase::TYPE_ANGLE:
-               set_link("lhs",ValueNode_Const::create(Vector(1,0)));
-               set_link("rhs",ValueNode_Const::create(Vector(0,1)));
+               set_link("lhs",ValueNode_Const::create(Vector(Angle::cos(value.get(Angle())).get(), Angle::sin(value.get(Angle())).get())));
+               set_link("rhs",ValueNode_Const::create(Vector(1,0)));
                break;
        default:
                throw Exception::BadType(ValueBase::type_local_name(value.get_type()));