I am trying to replace one object with another object of a different size. If there is no rotation everything works fine. As soon as rotation is added the new object is shifted. Rotation is performed around the centre of the object. Height and width are calculated before rotation.