From 7ffa084cbb49cf449d74b99d2c514747784b480d Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 1 Mar 2018 15:17:35 +1100 Subject: [PATCH] Fix bounds method --- src/ImageSharp/DefaultInternalImageProcessorContext.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/DefaultInternalImageProcessorContext.cs b/src/ImageSharp/DefaultInternalImageProcessorContext.cs index c3378cf98..7ccc65e27 100644 --- a/src/ImageSharp/DefaultInternalImageProcessorContext.cs +++ b/src/ImageSharp/DefaultInternalImageProcessorContext.cs @@ -52,7 +52,7 @@ namespace SixLabors.ImageSharp } /// - public Size GetCurrentSize() => this.destination?.Size() ?? this.source.Size(); + public Size GetCurrentSize() => this.GetCurrentBounds().Size; /// public IImageProcessingContext ApplyProcessor(IImageProcessor processor, Rectangle rectangle) @@ -78,7 +78,12 @@ namespace SixLabors.ImageSharp /// public IImageProcessingContext ApplyProcessor(IImageProcessor processor) { - return this.ApplyProcessor(processor, this.source.Bounds()); + return this.ApplyProcessor(processor, this.GetCurrentBounds()); + } + + private Rectangle GetCurrentBounds() + { + return this.destination?.Bounds() ?? this.source.Bounds(); } } } \ No newline at end of file