When right-clicking on a simple waypoint in a PasteCanvas' 'canvas' parameter, pop...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 24 Oct 2007 16:46:42 +0000 (16:46 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 24 Oct 2007 16:46:42 +0000 (16:46 +0000)
git-svn-id: http://svn.voria.com/code@961 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/cellrenderer_timetrack.cpp
synfig-studio/trunk/src/gtkmm/cellrenderer_timetrack.h

index 4d3ff7c..1a91215 100644 (file)
@@ -762,7 +762,7 @@ CellRenderer_TimeTrack::activate_vfunc(
 
                                if(clickfound && node)
                                {
-                                       show_timepoint_menu(node, stime, actual_time+time_offset<stime?SIDE_LEFT:SIDE_RIGHT);
+                                       show_timepoint_menu(node, stime, time_offset, actual_time+time_offset<stime?SIDE_LEFT:SIDE_RIGHT);
                                }
                        }
 
@@ -931,7 +931,7 @@ set_waypoint_model(std::set<synfig::Waypoint, std::less<UniqueID> > waypoints, W
 }
 
 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;
@@ -1013,13 +1013,15 @@ CellRenderer_TimeTrack::show_timepoint_menu(const etl::handle<synfig::Node>& nod
                                *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;
index a598d9b..98af667 100644 (file)
@@ -173,7 +173,7 @@ public:
        CellRenderer_TimeTrack();
     ~CellRenderer_TimeTrack();
 
-       void show_timepoint_menu(const etl::handle<synfig::Node>& node, const synfig::Time& time, Side side=SIDE_RIGHT);
+       void show_timepoint_menu(const etl::handle<synfig::Node>& node, const synfig::Time& time, const synfig::Time& time_offset, Side side=SIDE_RIGHT);
 
        void set_adjustment(Gtk::Adjustment &x);
        Gtk::Adjustment *get_adjustment();