mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Added scaling for the image container
This commit is contained in:
parent
621cc7fd0c
commit
52f56d7be5
2 changed files with 45 additions and 6 deletions
|
@ -47,6 +47,11 @@ namespace Greenshot.Drawing {
|
|||
private static readonly ILog LOG = LogManager.GetLogger(typeof(DrawableContainer));
|
||||
protected static readonly EditorConfiguration EditorConfig = IniConfig.GetIniSection<EditorConfiguration>();
|
||||
private bool _isMadeUndoable;
|
||||
private const int M11 = 0;
|
||||
private const int M12 = 1;
|
||||
private const int M21 = 2;
|
||||
private const int M22 = 3;
|
||||
|
||||
|
||||
protected EditStatus _defaultEditMode = EditStatus.DRAWING;
|
||||
public EditStatus DefaultEditMode {
|
||||
|
@ -692,6 +697,24 @@ namespace Greenshot.Drawing {
|
|||
Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve the Y scale from the matrix
|
||||
/// </summary>
|
||||
/// <param name="matrix"></param>
|
||||
/// <returns></returns>
|
||||
public static float CalculateScaleY(Matrix matrix) {
|
||||
return matrix.Elements[M22];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve the X scale from the matrix
|
||||
/// </summary>
|
||||
/// <param name="matrix"></param>
|
||||
/// <returns></returns>
|
||||
public static float CalculateScaleX(Matrix matrix) {
|
||||
return matrix.Elements[M11];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve the rotation angle from the matrix
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue