Fixed potential issue when multiple effects are used after each other.

This commit is contained in:
RKrom 2014-06-02 10:53:18 +02:00
parent 52f56d7be5
commit 2220f41122

View file

@ -1377,10 +1377,10 @@ namespace GreenshotPlugin.Core {
Image newImage = null;
if (maintainAspectRatio && canvasUseNewSize) {
newImage = CreateEmpty(newWidth, newHeight, sourceImage.PixelFormat, backgroundColor, sourceImage.HorizontalResolution, sourceImage.VerticalResolution);
matrix.Scale((float)newWidth / sourceImage.Width, (float)newHeight / sourceImage.Height);
matrix.Scale((float)newWidth / sourceImage.Width, (float)newHeight / sourceImage.Height, MatrixOrder.Append);
} else {
newImage = CreateEmpty(destWidth, destHeight, sourceImage.PixelFormat, backgroundColor, sourceImage.HorizontalResolution, sourceImage.VerticalResolution);
matrix.Scale((float)destWidth / sourceImage.Width, (float)destHeight / sourceImage.Height);
matrix.Scale((float)destWidth / sourceImage.Width, (float)destHeight / sourceImage.Height, MatrixOrder.Append);
}
using (Graphics graphics = Graphics.FromImage(newImage)) {