From 5cb877f8c87bfe65d482108975beb6edee086dec Mon Sep 17 00:00:00 2001 From: RKrom Date: Sun, 1 Jun 2014 11:25:27 +0200 Subject: [PATCH] Found that the matrix is prepending, which explains why the translation needed wrong values. --- GreenshotPlugin/Core/Effects.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GreenshotPlugin/Core/Effects.cs b/GreenshotPlugin/Core/Effects.cs index 0bec57986..0a5ea4c57 100644 --- a/GreenshotPlugin/Core/Effects.cs +++ b/GreenshotPlugin/Core/Effects.cs @@ -214,13 +214,13 @@ namespace Greenshot.Core { public Image Apply(Image sourceImage, Matrix matrix) { RotateFlipType flipType; if (Angle == 90) { - matrix.Rotate(90); - matrix.Translate(0, -sourceImage.Height); + matrix.Rotate(90, MatrixOrder.Append); + matrix.Translate(sourceImage.Height, 0, MatrixOrder.Append); flipType = RotateFlipType.Rotate90FlipNone; } else if (Angle == -90 || Angle == 270) { flipType = RotateFlipType.Rotate270FlipNone; - matrix.Rotate(-90); - matrix.Translate(-sourceImage.Width, 0); + matrix.Rotate(-90, MatrixOrder.Append); + matrix.Translate(0, sourceImage.Width, MatrixOrder.Append); } else { throw new NotSupportedException("Currently only an angle of 90 or -90 (270) is supported."); }