Author: Carlos Lopez <[email protected]>
Date:   Mon Jul 18 20:16:20 2011 +0200

When manipulating a BLineCalc Vertex, use homogeneous index if enabled.

---

 synfig-studio/src/gui/duckmatic.cpp                |    4 +++-
 .../src/synfigapp/actions/valuedescset.cpp         |    4 ++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/synfig-studio/src/gui/duckmatic.cpp 
b/synfig-studio/src/gui/duckmatic.cpp
index 4d69666..8fd72d7 100644
--- a/synfig-studio/src/gui/duckmatic.cpp
+++ b/synfig-studio/src/gui/duckmatic.cpp
@@ -500,7 +500,9 @@ Duckmatic::update_ducks()
                                                synfig::Real radius = 0.0;
                                                ValueNode_BLine::Handle 
bline(ValueNode_BLine::Handle::cast_dynamic(bline_vertex->get_link("bline")));
                                                Real amount = 
synfig::find_closest_point((*bline)(time), duck->get_point(), radius, 
bline->get_loop());
-
+                                               bool 
homogeneous((*(bline_vertex->get_link("homogeneous")))(time).get(bool()));
+                                               if(homogeneous)
+                                                       
amount=std_to_hom((*bline)(time), amount, bline->get_loop(), 
((*(bline_vertex->get_link("loop")))(time).get(bool())) );
                                                ValueNode::Handle 
vertex_amount_value_node(bline_vertex->get_link("amount"));
 
 
diff --git a/synfig-studio/src/synfigapp/actions/valuedescset.cpp 
b/synfig-studio/src/synfigapp/actions/valuedescset.cpp
index 79eb889..204de6b 100644
--- a/synfig-studio/src/synfigapp/actions/valuedescset.cpp
+++ b/synfig-studio/src/synfigapp/actions/valuedescset.cpp
@@ -409,6 +409,7 @@ Action::ValueDescSet::prepare()
                        // outside the range of 0-1, so make sure that the 
amount does
                        // not change drastically.
                        Real 
amount_old((*(bline_vertex->get_link("amount")))(time).get(Real()));
+
                        Real amount_new = 
synfig::find_closest_point((*bline)(time), value, radius, bline->get_loop());
                        Real difference = fmod( fmod(amount_new - amount_old, 
1.0) + 1.0 , 1.0);
                        //fmod is called twice to avoid negative values
@@ -418,6 +419,9 @@ Action::ValueDescSet::prepare()
                }
                else
                        new_amount = synfig::find_closest_point((*bline)(time), 
value, radius, bline->get_loop());
+               bool 
homogeneous((*(bline_vertex->get_link("homogeneous")))(time).get(bool()));
+               if(homogeneous)
+                       new_amount=std_to_hom((*bline)(time), new_amount, 
bline->get_loop(), ((*(bline_vertex->get_link("loop")))(time).get(bool())) );
                Action::Handle action(Action::create("ValueDescSet"));
                if(!action)
                        throw Error(_("Unable to find action ValueDescSet 
(bug)"));


------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to