From 41063fc828642a7ae12aeb50694f1cd4580eb467 Mon Sep 17 00:00:00 2001 From: dooglus Date: Wed, 20 Feb 2008 01:32:33 +0000 Subject: [PATCH] Remove the special case code for when the screen is 'flipped'. Arbitrary transformations can be in place, so let's not try to special case them all. Just let the radius ducks go where they are transformed to. git-svn-id: http://svn.voria.com/code@1779 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/duckmatic.cpp | 20 ++++---------------- synfig-studio/trunk/src/gtkmm/duckmatic.h | 6 ------ synfig-studio/trunk/src/gtkmm/state_circle.cpp | 4 ++-- synfig-studio/trunk/src/gtkmm/workarea.cpp | 3 --- 4 files changed, 6 insertions(+), 27 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp index f5e52de..15ee0c9 100644 --- a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp +++ b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp @@ -108,18 +108,6 @@ Duckmatic::~Duckmatic() } void -Duckmatic::set_flip_x(bool flip_x) -{ - flip_x_ = flip_x; -} - -void -Duckmatic::set_flip_y(bool flip_y) -{ - flip_y_ = flip_y; -} - -void Duckmatic::clear_ducks() { duck_data_share_map.clear(); @@ -564,12 +552,12 @@ Duckmatic::signal_edited_selected_ducks() Point point((*iter)->get_point()); bool changed = false; - if (point[0] * (flip_x_ ? -1 : 1) < 0) + if (point[0] < 0) { point[0] = 0; changed = true; } - if (point[1] * (flip_y_ ? -1 : 1) < 0) + if (point[1] < 0) { point[1] = 0; changed = true; @@ -1036,8 +1024,8 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handleset_radius(true); duck->set_type(Duck::TYPE_RADIUS); - // put the duck on the right hand side of the center, whether the display is flipped or not - duck->set_point(Point(value_desc.get_value(get_time()).get(Real()) * (flip_x_ ? -1 : 1), 0)); + // put the duck on the right hand side of the center + duck->set_point(Point(value_desc.get_value(get_time()).get(Real()), 0)); duck->set_name(guid_string(value_desc)); if(value_desc.is_value_node()) { diff --git a/synfig-studio/trunk/src/gtkmm/duckmatic.h b/synfig-studio/trunk/src/gtkmm/duckmatic.h index d197549..f313255 100644 --- a/synfig-studio/trunk/src/gtkmm/duckmatic.h +++ b/synfig-studio/trunk/src/gtkmm/duckmatic.h @@ -193,9 +193,6 @@ private: mutable synfig::String sketch_filename_; - //! whether the display is flipped vertically or horizontally - bool flip_x_, flip_y_; - /* -- ** -- P R O T E C T E D D A T A ----------------------------------------- */ @@ -242,9 +239,6 @@ public: Duckmatic(); virtual ~Duckmatic(); - void set_flip_x(bool flip_x); - void set_flip_y(bool flip_y); - sigc::signal& signal_duck_selection_changed() { return signal_duck_selection_changed_; } sigc::signal& signal_strokes_changed() { return signal_strokes_changed_; } sigc::signal& signal_grid_changed() { return signal_grid_changed_; } diff --git a/synfig-studio/trunk/src/gtkmm/state_circle.cpp b/synfig-studio/trunk/src/gtkmm/state_circle.cpp index fb06cd5..244862d 100644 --- a/synfig-studio/trunk/src/gtkmm/state_circle.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_circle.cpp @@ -494,8 +494,8 @@ StateCircle_Context::event_mouse_click_handler(const Smach::event& x) if (App::restrict_radius_ducks) { - if ((point[0] - point_holder[0]) * get_work_area()->get_pw() < 0) point[0] = point_holder[0]; - if ((point[1] - point_holder[1]) * get_work_area()->get_ph() > 0) point[1] = point_holder[1]; + if ((point[0] - point_holder[0]) < 0) point[0] = point_holder[0]; + if ((point[1] - point_holder[1]) < 0) point[1] = point_holder[1]; } make_circle(point_holder, point); diff --git a/synfig-studio/trunk/src/gtkmm/workarea.cpp b/synfig-studio/trunk/src/gtkmm/workarea.cpp index e783687..09c38f2 100644 --- a/synfig-studio/trunk/src/gtkmm/workarea.cpp +++ b/synfig-studio/trunk/src/gtkmm/workarea.cpp @@ -1924,9 +1924,6 @@ WorkArea::refresh_dimension_info() pw=canvaswidth/w; ph=canvasheight/h; - Duckmatic::set_flip_x(pw < 0); - Duckmatic::set_flip_y(ph > 0); - scrollx_adjustment.set_page_increment(abs(get_grid_size()[0])); scrollx_adjustment.set_step_increment(abs(pw)); scrollx_adjustment.set_lower(-abs(canvaswidth)); -- 2.7.4