25 #ifndef __SYNFIG_STUDIO_DUCK_TRANSFORM_SCALE_H
26 #define __SYNFIG_STUDIO_DUCK_TRANSFORM_SCALE_H
44 synfig::Vector origin;
46 Transform_Scale(
const synfig::GUID& guid,
const synfig::Vector& scale,
const synfig::Vector& origin=synfig::Vector(0,0)):
47 Transform(guid), scale(scale), origin(origin) { }
48 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]); }
49 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]); }