From: dooglus Date: Sat, 9 Feb 2008 00:00:56 +0000 (+0000) Subject: Always draw 'real' ducks on the right hand side of the circle they define. Previousl... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=06b7eccae8f804c78c3f0d99fe5071a0e34f53ae;p=synfig.git Always draw 'real' ducks on the right hand side of the circle they define. Previously, canvases with a negative horizontal pixel width were drawing it on the left. git-svn-id: http://svn.voria.com/code@1631 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp index 118d339..110a356 100644 --- a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp +++ b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp @@ -108,6 +108,18 @@ 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(); @@ -995,7 +1007,8 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handleset_radius(true); duck->set_type(Duck::TYPE_RADIUS); - duck->set_point(Point(value_desc.get_value(get_time()).get(Real()),0)); + // 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)); 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 a7340be..2b160cf 100644 --- a/synfig-studio/trunk/src/gtkmm/duckmatic.h +++ b/synfig-studio/trunk/src/gtkmm/duckmatic.h @@ -193,6 +193,9 @@ 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 ----------------------------------------- */ @@ -239,6 +242,9 @@ 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/workarea.cpp b/synfig-studio/trunk/src/gtkmm/workarea.cpp index 22b0526..84bebd8 100644 --- a/synfig-studio/trunk/src/gtkmm/workarea.cpp +++ b/synfig-studio/trunk/src/gtkmm/workarea.cpp @@ -1921,6 +1921,9 @@ 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));