property_adjustment_(*this,"adjustment",&adjustment_),
property_enable_timing_info_(*this,"enable-timing-info", false)
{
- dragging=false;
+ dragging=false;
selection=false;
}
Time stime;
synfigapp::ValueDesc valdesc = property_value_desc().get_value();
const Node::time_set *tset = get_times_from_vdesc(valdesc);
+ synfig::Time time_offset = get_time_offset_from_vdesc(valdesc);
- bool clickfound = tset && get_closest_time(*tset,actual_time+get_time_offset_from_vdesc(valdesc),pixel_width*cell_area.get_height(),stime);
+ bool clickfound = tset && get_closest_time(*tset,actual_time+time_offset,pixel_width*cell_area.get_height(),stime);
etl::handle<synfig::Node> node;
if(valdesc.get_value(stime).get_type()==ValueBase::TYPE_CANVAS)
if(clickfound && node)
{
- show_timepoint_menu(node, stime, actual_time<stime?SIDE_LEFT:SIDE_RIGHT);
+ show_timepoint_menu(node, stime, time_offset, actual_time+time_offset<stime?SIDE_LEFT:SIDE_RIGHT);
}
}
}
void
-CellRenderer_TimeTrack::show_timepoint_menu(const etl::handle<synfig::Node>& node, const synfig::Time& time, Side side)
+CellRenderer_TimeTrack::show_timepoint_menu(const etl::handle<synfig::Node>& node, const synfig::Time& time, const synfig::Time& time_offset, Side side)
{
std::set<synfig::Waypoint, std::less<UniqueID> > waypoint_set;
int n;
n=synfig::waypoint_collect(waypoint_set,time,node);
Gtk::Menu* menu(manage(new Gtk::Menu()));
+ menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu));
// Create the interpolation method menu
if(!waypoint_set.empty())
{
Gtk::Menu* interp_menu(manage(new Gtk::Menu()));
+ // no need to connect to signal_hide for this one - it will be deleted when its parent is deleted
Waypoint::Model model;
// note: each of the following 4 'if' blocks provokes these warnings:
*canvas_interface(),
&synfigapp::CanvasInterface::set_time
),
- time
+ time - time_offset
)
));
if(!waypoint_set.empty())
{
- if(waypoint_set.size()==1)
+ // attempting to locate the valuenode for the clicked waypoint doesn't work if this is a Canvas parameter,
+ // so act as if there were multiple waypoints in that case as a workaround
+ if(waypoint_set.size()==1 && !Canvas::Handle::cast_dynamic(node))
{
delete menu;
menu=0;