Skip to content

Commit 34dbdfd

Browse files
committed
Correct code to use temporaryDefines instead.
1 parent c022bb0 commit 34dbdfd

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/Magick.NET/MagickImage.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,18 +2190,10 @@ public void Composite(IMagickImage image, Gravity gravity, int x, int y, Composi
21902190
{
21912191
Throw.IfNull(nameof(image), image);
21922192

2193-
if (args is not null)
2194-
_nativeInstance.SetArtifact("compose:args", args);
2193+
using var temporaryDefines = new TemporaryDefines(this);
2194+
temporaryDefines.SetArtifact("compose:args", args);
21952195

2196-
try
2197-
{
2198-
_nativeInstance.CompositeGravity(image, gravity, x, y, compose, channels);
2199-
}
2200-
finally
2201-
{
2202-
if (args is not null)
2203-
_nativeInstance.RemoveArtifact("compose:args");
2204-
}
2196+
_nativeInstance.CompositeGravity(image, gravity, x, y, compose, channels);
22052197
}
22062198

22072199
/// <summary>

0 commit comments

Comments
 (0)