/// <summary> /// Creates a new instance of a Distortion Service /// </summary> /// <param name="distortion">The distortion to be performed</param> /// <param name="source">The graphics path to be distorted</param> /// <param name="flatness">The precision of the flattening operation (smaller = more points = slower)</param> public DistortionService(IDistortion distortion, GraphicsPath source, float flatness = .2f) { _distortion = distortion; _source = source; _flatness = flatness; _source.Flatten(null, flatness); }
/// <summary> /// Изменяет текущий объект дисторшна на новый. /// </summary> /// <param name="newDistortion">Новый объект дисторшна.</param> private void ChangeDistortion(IDistortion newDistortion) { currentDistortion = newDistortion; currentDistortion?.SetAmount(amount); }