mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 21:43:24 -07:00
Found that the matrix is prepending, which explains why the translation needed wrong values.
This commit is contained in:
parent
240ac6d947
commit
5cb877f8c8
1 changed files with 4 additions and 4 deletions
|
@ -214,13 +214,13 @@ namespace Greenshot.Core {
|
||||||
public Image Apply(Image sourceImage, Matrix matrix) {
|
public Image Apply(Image sourceImage, Matrix matrix) {
|
||||||
RotateFlipType flipType;
|
RotateFlipType flipType;
|
||||||
if (Angle == 90) {
|
if (Angle == 90) {
|
||||||
matrix.Rotate(90);
|
matrix.Rotate(90, MatrixOrder.Append);
|
||||||
matrix.Translate(0, -sourceImage.Height);
|
matrix.Translate(sourceImage.Height, 0, MatrixOrder.Append);
|
||||||
flipType = RotateFlipType.Rotate90FlipNone;
|
flipType = RotateFlipType.Rotate90FlipNone;
|
||||||
} else if (Angle == -90 || Angle == 270) {
|
} else if (Angle == -90 || Angle == 270) {
|
||||||
flipType = RotateFlipType.Rotate270FlipNone;
|
flipType = RotateFlipType.Rotate270FlipNone;
|
||||||
matrix.Rotate(-90);
|
matrix.Rotate(-90, MatrixOrder.Append);
|
||||||
matrix.Translate(-sourceImage.Width, 0);
|
matrix.Translate(0, sourceImage.Width, MatrixOrder.Append);
|
||||||
} else {
|
} else {
|
||||||
throw new NotSupportedException("Currently only an angle of 90 or -90 (270) is supported.");
|
throw new NotSupportedException("Currently only an angle of 90 or -90 (270) is supported.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue