diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-24 18:15:02 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-24 18:15:02 -0400 |
commit | 93274deb4aba6eb60b5471a81819eb92e23de30b (patch) | |
tree | 3535cd782f0973c8ecd95fb44b476464cc1a661f /src | |
parent | da22446964f4dba0047a29dee3efec7c00835048 (diff) | |
download | SMAPI-93274deb4aba6eb60b5471a81819eb92e23de30b.tar.gz SMAPI-93274deb4aba6eb60b5471a81819eb92e23de30b.tar.bz2 SMAPI-93274deb4aba6eb60b5471a81819eb92e23de30b.zip |
minor fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/SMAPI/Framework/Content/AssetDataForImage.cs | 6 | ||||
-rw-r--r-- | src/SMAPI/IAssetDataForImage.cs | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/SMAPI/Framework/Content/AssetDataForImage.cs b/src/SMAPI/Framework/Content/AssetDataForImage.cs index 1eef2afb..5c7b87de 100644 --- a/src/SMAPI/Framework/Content/AssetDataForImage.cs +++ b/src/SMAPI/Framework/Content/AssetDataForImage.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework.Graphics; namespace StardewModdingAPI.Framework.Content { - /// <summary>Encapsulates access and changes to dictionary content being read from a data file.</summary> + /// <summary>Encapsulates access and changes to image content being read from a data file.</summary> internal class AssetDataForImage : AssetData<Texture2D>, IAssetDataForImage { /********* @@ -29,6 +29,8 @@ namespace StardewModdingAPI.Framework.Content public void PatchImage(Texture2D source, Rectangle? sourceArea = null, Rectangle? targetArea = null, PatchMode patchMode = PatchMode.Replace) { // get texture + if (source == null) + throw new ArgumentNullException(nameof(source), "Can't patch from a null source texture."); Texture2D target = this.Data; // get areas @@ -36,8 +38,6 @@ namespace StardewModdingAPI.Framework.Content targetArea = targetArea ?? new Rectangle(0, 0, Math.Min(sourceArea.Value.Width, target.Width), Math.Min(sourceArea.Value.Height, target.Height)); // validate - if (source == null) - throw new ArgumentNullException(nameof(source), "Can't patch from a null source texture."); if (sourceArea.Value.X < 0 || sourceArea.Value.Y < 0 || sourceArea.Value.Right > source.Width || sourceArea.Value.Bottom > source.Height) throw new ArgumentOutOfRangeException(nameof(sourceArea), "The source area is outside the bounds of the source texture."); if (targetArea.Value.X < 0 || targetArea.Value.Y < 0 || targetArea.Value.Right > target.Width || targetArea.Value.Bottom > target.Height) diff --git a/src/SMAPI/IAssetDataForImage.cs b/src/SMAPI/IAssetDataForImage.cs index 4584a20e..1109194f 100644 --- a/src/SMAPI/IAssetDataForImage.cs +++ b/src/SMAPI/IAssetDataForImage.cs @@ -1,10 +1,10 @@ -using System; +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace StardewModdingAPI { - /// <summary>Encapsulates access and changes to dictionary content being read from a data file.</summary> + /// <summary>Encapsulates access and changes to image content being read from a data file.</summary> public interface IAssetDataForImage : IAssetData<Texture2D> { /********* |