//TODO: SOMETHING STILL HAS TO BE DONE WITH THE OTHER DIRECTION
// (recursing down the tree needs to take this into account too...)
for(; i != end; ++i)
- set.insert(*i - time_offset);
+ set.insert(*i
+#ifdef ADJUST_WAYPOINTS_FOR_TIME_OFFSET // see node.h
+ - time_offset
+#endif
+ );
Layer::get_times_vfunc(set);
}
/* === M A C R O S ========================================================= */
+// When a PasteCanvas layer has a non-zero 'time offset' parameter, should
+// the waypoints shown for the canvas be adjusted? This currently only
+// partially works - see the TODO at the end of layer_pastecanvas.cpp
+// #define ADJUST_WAYPOINTS_FOR_TIME_OFFSET
+
/* === T Y P E D E F S ===================================================== */
/* === C L A S S E S & S T R U C T S ======================================= */
if(canvasparam)
{
+#ifdef ADJUST_WAYPOINTS_FOR_TIME_OFFSET // see node.h
+ synfig::Time::value_type time_offset = 0;
+ if (v.parent_is_layer_param())
+ {
+ synfig::Layer::Handle layer = v.get_layer();
+ if (layer->get_name()=="PasteCanvas")
+ time_offset = layer->get_param("time_offset").get(Time());
+ }
+
+ const Node::time_set *times = &canvasparam->get_times();
+
+ if (time_offset)
+ {
+ //! \todo this is a memory leak - blame the 'kind of hack' above
+ Node::time_set *tmp = new Node::time_set;
+ Node::time_set::iterator i = times->begin(), end = times->end();
+ for (; i != end; ++i)
+ tmp->insert(*i - time_offset);
+ return tmp;
+ }
+
+ return times;
+#else // ADJUST_WAYPOINTS_FOR_TIME_OFFSET
return &canvasparam->get_times();
+#endif
}
}