X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fvaluenode_duplicate.cpp;h=56f742564e5b4e097badbe083811e8af46aa1739;hb=7e79f447f0b72d717d21dc16b20a71b2e74198d6;hp=2af20e77e41666140f853c67938e25f37a8aa513;hpb=6f8559ddcb82636029d07776700d51b0e0c35e92;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/valuenode_duplicate.cpp b/synfig-core/trunk/src/synfig/valuenode_duplicate.cpp index 2af20e7..56f7425 100644 --- a/synfig-core/trunk/src/synfig/valuenode_duplicate.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_duplicate.cpp @@ -158,6 +158,7 @@ ValueNode_Duplicate::step(Time t)const Real from = (*from_)(t).get(Real()); Real to = (*to_ )(t).get(Real()); Real step = (*step_)(t).get(Real()); + Real prev = index; if (step == 0) return false; @@ -165,14 +166,14 @@ ValueNode_Duplicate::step(Time t)const if (from < to) { - index += step; - return index <= to; + if ((index += step) <= to) return true; } else - { - index -= step; - return index >= to; - } + if ((index -= step) >= to) return true; + + // at the end of the loop, leave the index at the last value that was used + index = prev; + return false; } int