Fixing libtool issues

This morning I realized that I can’t build git version of Synfig on my friend’s PC. Build failed on the first stage after invoking  “autoreconf –install –force” for synfig-core.

Using “git grep libltdl” I’ve found commented “AC_CONFIG_SUBDIRS(libltdl)” line in synfig-core/configure.ac and comment above:

# this line is required for libtool 1.5.26 but must not be present for libtool 2.2.4...

I was sure that there should be a way to resolve that incompatibility. After googling around a bit I have found similar case described on this page: https://gnunet.org/mantis/view.php?id=1340.

K, sending patch to tracker…

Leave a Comment

Patch tracker

I’ve posted my first patch to Synfig’s dourceforge.net bugtracker, but looks like synfig developers using patches.synfig.org

Comments (1)

Looking for a way to modify “Link” action

K, lets proceed to the next stage – find a way to insert additional converts in special cases at the moment of invoking “Link” command.

Read the rest of this entry »

Leave a Comment

Reverse manipulations for Scale Convert – Part 3

Right after the CanvasView::on_duck_changed() function I have found CanvasView::on_duck_angle_changed() function. Looks like Angle ducks defining rotation are handled exclusively. Why? Let’s examine it…

Read the rest of this entry »

Leave a Comment

Reverse manipulations for Scale Convert – Part 2

The solution came when I looked at the end of CanvasView::on_duck_changed() function:

bool
CanvasView::on_duck_changed(const synfig::Point &value,const synfigapp::ValueDesc& value_desc)
{
	//Handling other convert types (LinkToBline)
	if (ValueNode_BLineCalcWidth::Handle bline_width = ValueNode_BLineCalcWidth::Handle::cast_dynamic(value_desc.get_value_node()))
	{
		...
	}

	...

	//Handling Scale Convert
	if (ValueNode_Scale::Handle scale_value_node = ValueNode_Scale::Handle::cast_dynamic(value_desc.get_value_node()))
	{
		//Our code
		int scalar_index(scale_value_node->get_link_index_from_name("scalar"));
		Real scalar((*(scale_value_node->get_link(scalar_index)))(get_time()).get(Real()));
		if (scalar == 0.0)
		{
			return false;
		}
		else
		{
			int link_index(scale_value_node->get_link_index_from_name("link"));
			return canvas_interface()->change_value(synfigapp::ValueDesc(scale_value_node,link_index), value / scalar);
		}
	}

	//Interesting part:
	switch(value_desc.get_value_type())
	{
	case ValueBase::TYPE_REAL:
		return canvas_interface()->change_value(value_desc,value.mag());
	case ValueBase::TYPE_ANGLE:
		return canvas_interface()->change_value(value_desc,Angle::tan(value[1],value[0]));
	default:
		return canvas_interface()->change_value(value_desc,value);
	}
}

Last lines of CanvasView::on_duck_changed() processing the case when the duck is not affected by any convert type – just passing value to the value_desc. Value variable is a Vector type, because it resides on the 2D plane – screen. But changed value node is not always a vector. It could be an Angle or Radius. For those cases value is converted to angle via Angle::tan() and value.mag() functions. “Mag” stays for “magnitude” for sure.

Read the rest of this entry »

Leave a Comment

Syntax highlighting on WordPress.com

Found a way to highlight source code on this blog with [sourcecode language=’cpp’]…[/sourcecode] tags. I hope code is more readable from now on. )))

Leave a Comment

Reverse manipulations for Scale Convert – Part 1

I’ve got first result. The patch below allows reverse manipulations for Scale convert type.

diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.cpp b/synfig-studio/trunk/src/gtkmm/canvasview.cpp
index 3154ae4..6a8e4cb 100644
--- a/synfig-studio/trunk/src/gtkmm/canvasview.cpp
+++ b/synfig-studio/trunk/src/gtkmm/canvasview.cpp
@@ -2684,6 +2684,21 @@ CanvasView::on_duck_changed(const synfig::Point &value,const synfigapp::ValueDes
}
}

+    if (ValueNode_Scale::Handle scale_value_node = ValueNode_Scale::Handle::cast_dynamic(value_desc.get_value_node()))
+    {
+        int scalar_index(scale_value_node->get_link_index_from_name("scalar"));
+        Real scalar((*(scale_value_node->get_link(scalar_index)))(get_time()).get(Real()));
+        if (scalar == 0.0)
+        {
+            return false;
+        }
+        else
+        {
+            int link_index(scale_value_node->get_link_index_from_name("link"));
+            return canvas_interface()->change_value(synfigapp::ValueDesc(scale_value_node,link_index), value / scalar);
+        }
+    }
+
switch(value_desc.get_value_type())
{
case ValueBase::TYPE_REAL:
diff --git a/synfig-studio/trunk/src/synfigapp/instance.cpp b/synfig-studio/trunk/src/synfigapp/instance.cpp
index 020d337..c3c542b 100644
--- a/synfig-studio/trunk/src/synfigapp/instance.cpp
+++ b/synfig-studio/trunk/src/synfigapp/instance.cpp
@@ -42,6 +42,7 @@
#include <synfig /valuenode_blinecalctangent.h>
#include </synfig><synfig /valuenode_blinecalcvertex.h>
#include </synfig><synfig /valuenode_blinecalcwidth.h>
+#include </synfig><synfig /valuenode_scale.h>
#include <map>

#include "general.h"
@@ -74,6 +75,7 @@ synfigapp::is_editable(synfig::ValueNode::Handle value_node)
         || ValueNode_BLineCalcVertex::Handle::cast_dynamic(value_node)
         || ValueNode_BLineCalcTangent::Handle::cast_dynamic(value_node)
         || ValueNode_BLineCalcWidth::Handle::cast_dynamic(value_node)
+        || ValueNode_Scale::Handle::cast_dynamic(value_node)
)
return true;
return false;

I’ll try to explain some parts of code above. But first want to remind you again what I have no knowledge of C/C++. Be prepared to see some nonsense mumbling here and there. 🙂

Ready? K, here we go.

Read the rest of this entry »

Comments (2)

« Newer Posts · Older Posts »