From 6542407861e99a0ed76bd1ba9d03ca164ec7269b Mon Sep 17 00:00:00 2001 From: dooglus Date: Sat, 9 Feb 2008 17:25:00 +0000 Subject: [PATCH] Show the size of circles as they are drawn using the draw tool. git-svn-id: http://svn.voria.com/code@1641 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/duck.cpp | 3 ++- synfig-studio/trunk/src/gtkmm/duck.h | 7 +++++++ synfig-studio/trunk/src/gtkmm/renderer_ducks.cpp | 2 +- synfig-studio/trunk/src/gtkmm/state_circle.cpp | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/duck.cpp b/synfig-studio/trunk/src/gtkmm/duck.cpp index 63bebe7..70f2fa8 100644 --- a/synfig-studio/trunk/src/gtkmm/duck.cpp +++ b/synfig-studio/trunk/src/gtkmm/duck.cpp @@ -72,7 +72,8 @@ Duck::Duck(): scalar(1), editable(false), radius_(false), - tangent_(false) + tangent_(false), + hover_(false) { duck_count++; _DuckCounter::counter++; } Duck::Duck(const synfig::Point &point): diff --git a/synfig-studio/trunk/src/gtkmm/duck.h b/synfig-studio/trunk/src/gtkmm/duck.h index 179fba7..7b96d9b 100644 --- a/synfig-studio/trunk/src/gtkmm/duck.h +++ b/synfig-studio/trunk/src/gtkmm/duck.h @@ -134,6 +134,7 @@ private: bool editable; bool radius_; bool tangent_; + bool hover_; synfig::TransformStack transform_stack_; @@ -167,6 +168,12 @@ public: //! \writeme bool get_tangent()const { return tangent_; } + //! Sets whether to show the duck as if it is being hovered over + void set_hover(bool h) { hover_=h; } + + //! Retrieves whether to show the duck as if it is being hovered over + bool get_hover()const { return hover_; } + 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/renderer_ducks.cpp b/synfig-studio/trunk/src/gtkmm/renderer_ducks.cpp index cab4d95..1030402 100644 --- a/synfig-studio/trunk/src/gtkmm/renderer_ducks.cpp +++ b/synfig-studio/trunk/src/gtkmm/renderer_ducks.cpp @@ -236,7 +236,7 @@ Renderer_Ducks::render_vfunc( } bool selected(get_work_area()->duck_is_selected(*iter)); - bool hover(*iter==hover_duck); + bool hover(*iter==hover_duck || (*iter)->get_hover()); shadow = selected?Gtk::SHADOW_IN:Gtk::SHADOW_OUT; diff --git a/synfig-studio/trunk/src/gtkmm/state_circle.cpp b/synfig-studio/trunk/src/gtkmm/state_circle.cpp index 878118e..72700a4 100644 --- a/synfig-studio/trunk/src/gtkmm/state_circle.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_circle.cpp @@ -474,6 +474,7 @@ StateCircle_Context::event_mouse_click_handler(const Smach::event& x) point2_duck->set_radius(true); point2_duck->set_scalar(-1); point2_duck->set_type(Duck::TYPE_RADIUS); + point2_duck->set_hover(true); get_work_area()->add_duck(point2_duck); return Smach::RESULT_ACCEPT; -- 2.7.4