From: dooglus Date: Fri, 26 Dec 2008 15:14:57 +0000 (+0000) Subject: Initialise the GUID for all Transform objects. Using random GUID values was causing... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=0d5d578cc0c1a680c4fe39e4ea8317e267311f12;p=synfig.git Initialise the GUID for all Transform objects. Using random GUID values was causing some selected ducks to become unselected when nudged. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2321 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/transform.h b/synfig-core/trunk/src/synfig/transform.h index a235b22..50bf7ff 100644 --- a/synfig-core/trunk/src/synfig/transform.h +++ b/synfig-core/trunk/src/synfig/transform.h @@ -49,7 +49,7 @@ public: typedef etl::handle Handle; protected: - Transform(const GUID& guid=GUID()):guid_(guid) { } + Transform(const GUID& guid):guid_(guid) { } public: diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.cpp b/synfig-studio/trunk/src/gtkmm/canvasview.cpp index b492958..3154ae4 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.cpp +++ b/synfig-studio/trunk/src/gtkmm/canvasview.cpp @@ -2845,9 +2845,9 @@ CanvasView::rebuild_ducks_layer_(synfig::TransformStack& transform_stack, synfig Vector focus(layer->get_param("focus").get(Vector())); if(!scale.is_equal_to(Vector(1,1))) - transform_stack.push(new Transform_Scale(scale,origin+focus)); + transform_stack.push(new Transform_Scale(layer->get_guid(), scale,origin+focus)); if(!origin.is_equal_to(Vector(0,0))) - transform_stack.push(new Transform_Translate(origin)); + transform_stack.push(new Transform_Translate(layer->get_guid(), origin)); rebuild_ducks_layer_(transform_stack,child_canvas,selected_list); diff --git a/synfig-studio/trunk/src/gtkmm/ducktransform_rotate.h b/synfig-studio/trunk/src/gtkmm/ducktransform_rotate.h index 2256c5b..5a4a338 100644 --- a/synfig-studio/trunk/src/gtkmm/ducktransform_rotate.h +++ b/synfig-studio/trunk/src/gtkmm/ducktransform_rotate.h @@ -47,7 +47,8 @@ private: synfig::Real cos_val; public: - Transform_Rotate(const synfig::Angle& angle,const synfig::Vector& origin=synfig::Vector(0,0)): + Transform_Rotate(const synfig::GUID& guid, const synfig::Angle& angle,const synfig::Vector& origin=synfig::Vector(0,0)): + Transform(guid), angle(angle), origin(origin), sin_val(synfig::Angle::sin(angle).get()), diff --git a/synfig-studio/trunk/src/gtkmm/ducktransform_scale.h b/synfig-studio/trunk/src/gtkmm/ducktransform_scale.h index 5b78225..348a580 100644 --- a/synfig-studio/trunk/src/gtkmm/ducktransform_scale.h +++ b/synfig-studio/trunk/src/gtkmm/ducktransform_scale.h @@ -43,7 +43,8 @@ private: synfig::Vector scale; synfig::Vector origin; public: - Transform_Scale(const synfig::Vector& scale,const synfig::Vector& origin=synfig::Vector(0,0)):scale(scale),origin(origin) { } + Transform_Scale(const synfig::GUID& guid, const synfig::Vector& scale,const synfig::Vector& origin=synfig::Vector(0,0)): + Transform(guid), scale(scale), origin(origin) { } synfig::Vector perform(const synfig::Vector& x)const { return synfig::Vector((x[0]-origin[0])*scale[0]+origin[0],(x[1]-origin[1])*scale[1]+origin[1]); } synfig::Vector unperform(const synfig::Vector& x)const { return synfig::Vector((x[0]-origin[0])/scale[0]+origin[0],(x[1]-origin[1])/scale[1]+origin[1]); } }; diff --git a/synfig-studio/trunk/src/gtkmm/ducktransform_translate.h b/synfig-studio/trunk/src/gtkmm/ducktransform_translate.h index 9249b65..fffd910 100644 --- a/synfig-studio/trunk/src/gtkmm/ducktransform_translate.h +++ b/synfig-studio/trunk/src/gtkmm/ducktransform_translate.h @@ -44,7 +44,7 @@ private: std::vector positions; public: - Transform_Translate(const synfig::Vector& origin): origin(origin) { } + Transform_Translate(const synfig::GUID& guid, const synfig::Vector& origin):Transform(guid), origin(origin) { } synfig::Vector perform(const synfig::Vector& x)const { return x+origin; } synfig::Vector unperform(const synfig::Vector& x)const { return x-origin; } }; // END of class synfig::Transform_Translate