@@ -2594,7 +2594,10 @@ public void Dispose()
25942594 /// <param name="arguments">An array containing the arguments for the distortion.</param>
25952595 /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
25962596 public void Distort ( DistortMethod method , params double [ ] arguments )
2597- => Distort ( new DistortSettings ( method ) , arguments ) ;
2597+ {
2598+ using var mutator = new Mutator ( _nativeInstance ) ;
2599+ mutator . Distort ( new DistortSettings ( method ) , arguments ) ;
2600+ }
25982601
25992602 /// <summary>
26002603 /// Distorts an image using various distortion methods, by mapping color lookups of the source
@@ -2606,14 +2609,8 @@ public void Distort(DistortMethod method, params double[] arguments)
26062609 /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
26072610 public void Distort ( IDistortSettings settings , params double [ ] arguments )
26082611 {
2609- Throw . IfNull ( nameof ( settings ) , settings ) ;
2610- Throw . IfNullOrEmpty ( nameof ( arguments ) , arguments ) ;
2611-
2612- using var temporaryDefines = new TemporaryDefines ( this ) ;
2613- temporaryDefines . SetArtifact ( "distort:scale" , settings . Scale ) ;
2614- temporaryDefines . SetArtifact ( "distort:viewport" , settings . Viewport ) ;
2615-
2616- _nativeInstance . Distort ( settings . Method , settings . Bestfit , arguments , ( nuint ) arguments . Length ) ;
2612+ using var mutator = new Mutator ( _nativeInstance ) ;
2613+ mutator . Distort ( settings , arguments ) ;
26172614 }
26182615
26192616 /// <summary>
0 commit comments