From: dooglus Date: Mon, 11 Feb 2008 23:12:04 +0000 (+0000) Subject: SVN r1677 partially broke the bline tool by making non-editable ducks selectable... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=587d6ca07e817b7a98e8eb4833492b2388184df4;p=synfig.git SVN r1677 partially broke the bline tool by making non-editable ducks selectable. The bline tool uses a non-editable duck under the mouse cursor to cause the dotted bline to be displayed as the mouse is moved. Added a new boolean to the Duck class "ignore_" for whether to ignore a duck when checking for user interaction, and set that boolean for this duck created by the bline tool. git-svn-id: http://svn.voria.com/code@1679 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/duck.cpp b/synfig-studio/trunk/src/gtkmm/duck.cpp index 58b0c64..eca6112 100644 --- a/synfig-studio/trunk/src/gtkmm/duck.cpp +++ b/synfig-studio/trunk/src/gtkmm/duck.cpp @@ -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--;} diff --git a/synfig-studio/trunk/src/gtkmm/duck.h b/synfig-studio/trunk/src/gtkmm/duck.h index 5631ac9..1366472 100644 --- a/synfig-studio/trunk/src/gtkmm/duck.h +++ b/synfig-studio/trunk/src/gtkmm/duck.h @@ -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& x) { connect_duck=x; } void set_box_duck(const etl::handle& x) { box_duck=x; } diff --git a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp index 2db91b8..bbf6f74 100644 --- a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp +++ b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp @@ -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) diff --git a/synfig-studio/trunk/src/gtkmm/state_bline.cpp b/synfig-studio/trunk/src/gtkmm/state_bline.cpp index 56d1b6d..61a30b2 100644 --- a/synfig-studio/trunk/src/gtkmm/state_bline.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_bline.cpp @@ -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);