SVN r1677 partially broke the bline tool by making non-editable ducks selectable...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 11 Feb 2008 23:12:04 +0000 (23:12 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 11 Feb 2008 23:12:04 +0000 (23:12 +0000)
git-svn-id: http://svn.voria.com/code@1679 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/duck.cpp
synfig-studio/trunk/src/gtkmm/duck.h
synfig-studio/trunk/src/gtkmm/duckmatic.cpp
synfig-studio/trunk/src/gtkmm/state_bline.cpp

index 58b0c64..eca6112 100644 (file)
@@ -74,7 +74,8 @@ Duck::Duck():
        editable(false),
        radius_(false),
        tangent_(false),
-       hover_(false)
+       hover_(false),
+       ignore_(false)
 { duck_count++; _DuckCounter::counter++; }
 
 Duck::Duck(const synfig::Point &point):
@@ -87,7 +88,8 @@ Duck::Duck(const synfig::Point &point):
        editable(false),
        radius_(false),
        tangent_(false),
-       hover_(false)
+       hover_(false),
+       ignore_(false)
 { duck_count++; _DuckCounter::counter++;}
 
 Duck::Duck(const synfig::Point &point,const synfig::Point &origin):
@@ -99,7 +101,8 @@ Duck::Duck(const synfig::Point &point,const synfig::Point &origin):
        editable(false),
        radius_(true),
        tangent_(false),
-       hover_(false)
+       hover_(false),
+       ignore_(false)
 { duck_count++; _DuckCounter::counter++;}
 
 Duck::~Duck() { duck_count--; _DuckCounter::counter--;}
index 5631ac9..1366472 100644 (file)
@@ -136,6 +136,7 @@ private:
        bool radius_;
        bool tangent_;
        bool hover_;
+       bool ignore_;
 
        synfig::TransformStack transform_stack_;
 
@@ -175,6 +176,12 @@ public:
        //! Retrieves whether to show the duck as if it is being hovered over
        bool get_hover()const { return hover_; }
 
+       //! Sets whether to ignore the duck when checking for user interaction
+       void set_ignore(bool i) { ignore_=i; }
+
+       //! Retrieves whether to ignore the duck when checking for user interaction
+       bool get_ignore()const { return ignore_; }
+
        void set_connect_duck(const etl::handle<Duck>& x) { connect_duck=x; }
        void set_box_duck(const etl::handle<Duck>& x) { box_duck=x; }
 
index 2db91b8..bbf6f74 100644 (file)
@@ -768,6 +768,8 @@ Duckmatic::find_duck(synfig::Point point, synfig::Real radius, Duck::Type type)
        {
                const Duck::Handle& duck(iter->second);
 
+               if(duck->get_ignore())
+                       continue;
                Real dist((duck->get_trans_point()-point).mag_squared());
 
                if(duck->get_type()&Duck::TYPE_VERTEX)
index 56d1b6d..61a30b2 100644 (file)
@@ -1134,12 +1134,12 @@ StateBLine_Context::refresh_ducks(bool button_down)
        if(bezier && !loop_)
        {
                duck=new WorkArea::Duck(bline_point.get_vertex());
-               duck->set_editable(false);
+               duck->set_ignore(true);
                duck->set_name("temp");
 
                // Add the tangent1 duck
                tduck=new WorkArea::Duck(Vector(0,0));
-               tduck->set_editable(false);
+               tduck->set_ignore(true);
                tduck->set_name("ttemp");
                tduck->set_origin(duck);
                tduck->set_scalar(-0.33333333333333333);