Holding ctrl while using sticker tool will use last sticker instead of opening sticker picker

This commit is contained in:
Jaex 2018-02-22 02:11:18 +03:00
parent d2ab43e329
commit 677ed9f95d
3 changed files with 6 additions and 4 deletions

View file

@ -87,7 +87,7 @@ public class AnnotationOptions
public List<StickerPackInfo> StickerPacks = new List<StickerPackInfo>();
public int SelectedStickerPack = 0;
public int StickerSize { get; set; } = 64;
public bool StickerQuickMode { get; set; } = false;
public string LastStickerPath { get; set; }
// Blur effect
public int BlurRadius { get; set; } = 15;

View file

@ -94,7 +94,7 @@ private bool LoadSticker(string filePath, int stickerSize)
if (img != null)
{
Manager.LastStickerPath = filePath;
AnnotationOptions.LastStickerPath = filePath;
img = ImageHelpers.ResizeImageLimit(img, stickerSize);
@ -112,7 +112,7 @@ public override void OnCreating()
Point pos = InputManager.ClientMousePosition;
Rectangle = new Rectangle(pos.X, pos.Y, 1, 1);
if (AnnotationOptions.StickerQuickMode && LoadSticker(Manager.LastStickerPath, AnnotationOptions.StickerSize))
if (Manager.IsCornerMoving && LoadSticker(AnnotationOptions.LastStickerPath, AnnotationOptions.StickerSize))
{
OnCreated();
Manager.IsMoving = true;

View file

@ -157,8 +157,11 @@ private set
public bool IsMoving { get; set; }
public bool IsPanning { get; set; }
public bool IsResizing { get; set; }
// Is holding Ctrl?
public bool IsCornerMoving { get; private set; }
// Is holding Shift?
public bool IsProportionalResizing { get; private set; }
// Is holding Alt?
public bool IsSnapResizing { get; private set; }
public bool IsRenderingOutput { get; private set; }
@ -217,7 +220,6 @@ public bool NodesVisible
public event Action<BaseShape> ShapeCreated;
internal RegionCaptureForm Form { get; private set; }
internal string LastStickerPath { get; set; }
private bool isLeftPressed, isRightPressed, isUpPressed, isDownPressed;