typedef etl::handle<Transform> Handle;
protected:
- Transform(const GUID& guid=GUID()):guid_(guid) { }
+ Transform(const GUID& guid):guid_(guid) { }
public:
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);
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()),
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]); }
};
std::vector<synfig::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