mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Removed "rotate" leftovers. Also implemented transform in the ImageContainer, be aware: scaling will probably cause artefakts if we "undo"...
This commit is contained in:
parent
4b8ec88aaf
commit
621cc7fd0c
3 changed files with 42 additions and 20 deletions
|
@ -692,10 +692,16 @@ namespace Greenshot.Drawing {
|
|||
Invalidate();
|
||||
}
|
||||
|
||||
public virtual bool CanRotate {
|
||||
get {
|
||||
return true;
|
||||
}
|
||||
/// <summary>
|
||||
/// Retrieve the rotation angle from the matrix
|
||||
/// </summary>
|
||||
/// <param name="matrix"></param>
|
||||
/// <returns></returns>
|
||||
public static int CalculateAngle(Matrix matrix) {
|
||||
const int M11 = 0;
|
||||
const int M21 = 2;
|
||||
var radians = Math.Atan2(matrix.Elements[M21], matrix.Elements[M11]);
|
||||
return (int)-Math.Round(radians * 180 / Math.PI);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue