mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-01 04:30:49 +12:00
Prevent cuts that would remove the entire image
And also don't show resize nodes
This commit is contained in:
parent
f9d144400e
commit
ce02e9ab07
|
@ -38,12 +38,24 @@ public class CutOutTool : BaseTool
|
|||
public bool IsHorizontalTrim => Rectangle.Width >= Options.MinimumSize && Rectangle.Width > Rectangle.Height;
|
||||
public bool IsVerticalTrim => Rectangle.Height >= Options.MinimumSize && Rectangle.Height >= Rectangle.Width;
|
||||
|
||||
public override bool IsValidShape => IsHorizontalTrim || IsVerticalTrim;
|
||||
public override bool IsValidShape {
|
||||
get
|
||||
{
|
||||
if (!IsHorizontalTrim && !IsVerticalTrim) return false;
|
||||
if (IsHorizontalTrim && Rectangle.Left <= Manager.Form.CanvasRectangle.Left && Rectangle.Right >= Manager.Form.CanvasRectangle.Right) return false;
|
||||
if (IsVerticalTrim && Rectangle.Top <= Manager.Form.CanvasRectangle.Top && Rectangle.Bottom >= Manager.Form.CanvasRectangle.Bottom) return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private ImageEditorButton confirmButton, cancelButton;
|
||||
private Size buttonSize = new Size(80, 40);
|
||||
private int buttonOffset = 15;
|
||||
|
||||
public override void ShowNodes()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnUpdate()
|
||||
{
|
||||
base.OnUpdate();
|
||||
|
|
Loading…
Reference in a new issue