From 7ca3669c1010bde48a0886bca8b79f661f5ef9b8 Mon Sep 17 00:00:00 2001 From: James South Date: Tue, 11 Feb 2014 16:41:03 +0000 Subject: [PATCH] Recalculating crop Former-commit-id: b4d69ed529a7afe0ade78659fd381d8dd300ff01 --- src/ImageProcessor/Processors/Crop.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ImageProcessor/Processors/Crop.cs b/src/ImageProcessor/Processors/Crop.cs index 336885b80..344f13f86 100644 --- a/src/ImageProcessor/Processors/Crop.cs +++ b/src/ImageProcessor/Processors/Crop.cs @@ -159,8 +159,10 @@ namespace ImageProcessor.Processors // Work out the percentages. float left = cropLayer.Left * sourceWidth; float top = cropLayer.Top * sourceWidth; - float right = (sourceWidth - (cropLayer.Right * sourceWidth)) - left; - float bottom = (sourceHeight - (cropLayer.Bottom * sourceHeight)) - top; + float right = sourceWidth - (cropLayer.Right * sourceWidth); + float bottom = sourceHeight - (cropLayer.Bottom * sourceHeight); + //float right = (sourceWidth - (cropLayer.Right * sourceWidth)) - left; + //float bottom = (sourceHeight - (cropLayer.Bottom * sourceHeight)) - top; rectangleF = new RectangleF(left, top, right, bottom); }