Fix the error about being unable to parse the grid_size metadata. It was previously...
[synfig.git] / synfig-studio / trunk / src / gtkmm / state_polygon.cpp
index f2eb6d4..410947a 100644 (file)
@@ -47,6 +47,8 @@
 #include "dialog_tooloptions.h"
 #include <synfigapp/main.h>
 
+#include "general.h"
+
 #endif
 
 /* === U S I N G =========================================================== */
@@ -186,7 +188,10 @@ StatePolygon_Context::increment_id()
        if(id[id.size()-1]<='9' && id[id.size()-1]>='0')
        {
                // figure out how many digits it is
-               for(digits=0;(int)id.size()-1>=digits && id[id.size()-1-digits]<='9' && id[id.size()-1-digits]>='0';digits++)while(false);
+               for (digits = 0;
+                        (int)id.size()-1 >= digits && id[id.size()-1-digits] <= '9' && id[id.size()-1-digits] >= '0';
+                        digits++)
+                       ;
 
                String str_number;
                str_number=String(id,id.size()-digits,id.size());
@@ -383,6 +388,7 @@ StatePolygon_Context::run()
                                action->set_param("canvas_interface",get_canvas_interface());
                                action->set_param("value_desc",value_desc);
                                action->set_param("type","dynamic_list");
+                               action->set_param("time",get_canvas_interface()->get_time());
                                if(!get_canvas_interface()->get_instance()->perform_action(action))
                                {
                                        group.cancel();
@@ -423,7 +429,8 @@ StatePolygon_Context::event_mouse_click_handler(const Smach::event& x)
                return Smach::RESULT_ACCEPT;
 
        case BUTTON_RIGHT: // Intercept the right-button click to short-circuit the pop-up menu
-               return Smach::RESULT_ACCEPT;
+               if (!getenv("SYNFIG_ENABLE_POPUP_MENU_IN_ALL_TOOLS"))
+                       return Smach::RESULT_ACCEPT;
 
        default:
                return Smach::RESULT_OK;