From: dooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Date: Wed, 9 Apr 2008 12:17:20 +0000 (+0000)
Subject: Default the time sub-parameter to 0f.  Check that the valuenode has a parent canvas... 
X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=820e061bbc686559b1b7f00da5db7964fc901b08;p=synfig.git

Default the time sub-parameter to 0f.  Check that the valuenode has a parent canvas before attempting to look up the frame rate in it.


git-svn-id: http://svn.voria.com/code@2001 1f10aa63-cdf2-0310-b900-c93c546f37ac
---

diff --git a/synfig-core/trunk/src/synfig/valuenode_timestring.cpp b/synfig-core/trunk/src/synfig/valuenode_timestring.cpp
index 0198716..628b504 100644
--- a/synfig-core/trunk/src/synfig/valuenode_timestring.cpp
+++ b/synfig-core/trunk/src/synfig/valuenode_timestring.cpp
@@ -57,7 +57,7 @@ ValueNode_TimeString::ValueNode_TimeString(const ValueBase &value):
 	switch(value.get_type())
 	{
 	case ValueBase::TYPE_STRING:
-		set_link("time",ValueNode_Const::create(Time()));
+		set_link("time",ValueNode_Const::create(Time(0)));
 		break;
 	default:
 		throw Exception::BadType(ValueBase::type_local_name(value.get_type()));
@@ -91,7 +91,10 @@ ValueNode_TimeString::operator()(Time t)const
 	switch (get_type())
 	{
 	case ValueBase::TYPE_STRING:
-		return time.get_string(get_parent_canvas()->rend_desc().get_frame_rate());
+		if (get_parent_canvas())
+			return time.get_string(get_parent_canvas()->rend_desc().get_frame_rate());
+		else
+			return time.get_string();
 	default:
 		break;
 	}