mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Added shape category
This commit is contained in:
parent
e3232dee70
commit
d3271e597b
5 changed files with 15 additions and 4 deletions
|
@ -166,6 +166,13 @@ public enum RegionCaptureAction // Localized
|
|||
CaptureActiveMonitor
|
||||
}
|
||||
|
||||
public enum ShapeCategory
|
||||
{
|
||||
Region,
|
||||
Drawing,
|
||||
Effect
|
||||
}
|
||||
|
||||
public enum ShapeType // Localized
|
||||
{
|
||||
RegionRectangle,
|
||||
|
|
|
@ -35,6 +35,8 @@ public abstract class BaseShape : IDisposable
|
|||
{
|
||||
protected const int MinimumSize = 3;
|
||||
|
||||
public abstract ShapeCategory ShapeCategory { get; }
|
||||
|
||||
public abstract ShapeType ShapeType { get; }
|
||||
|
||||
public Rectangle Rectangle { get; set; }
|
||||
|
@ -73,8 +75,6 @@ public Point EndPosition
|
|||
|
||||
public virtual bool IsValidShape => !Rectangle.IsEmpty && Rectangle.Width >= MinimumSize && Rectangle.Height >= MinimumSize;
|
||||
|
||||
public virtual bool IsRegionShape { get; } = false;
|
||||
|
||||
internal ShapeManager Manager { get; set; }
|
||||
|
||||
protected RegionCaptureOptions Options => Manager.Config;
|
||||
|
@ -136,7 +136,7 @@ public virtual void OnCreating()
|
|||
{
|
||||
Point pos = InputManager.MousePosition0Based;
|
||||
|
||||
if (Options.IsFixedSize && IsRegionShape)
|
||||
if (Options.IsFixedSize && ShapeCategory == ShapeCategory.Region)
|
||||
{
|
||||
Manager.IsMoving = true;
|
||||
Rectangle = new Rectangle(new Point(pos.X - Options.FixedSize.Width / 2, pos.Y - Options.FixedSize.Height / 2), Options.FixedSize);
|
||||
|
|
|
@ -29,6 +29,8 @@ namespace ShareX.ScreenCaptureLib
|
|||
{
|
||||
public abstract class BaseDrawingShape : BaseShape
|
||||
{
|
||||
public override ShapeCategory ShapeCategory { get; } = ShapeCategory.Drawing;
|
||||
|
||||
public Color BorderColor { get; set; }
|
||||
public int BorderSize { get; set; }
|
||||
public Color FillColor { get; set; }
|
||||
|
|
|
@ -29,6 +29,8 @@ namespace ShareX.ScreenCaptureLib
|
|||
{
|
||||
public abstract class BaseEffectShape : BaseShape
|
||||
{
|
||||
public override ShapeCategory ShapeCategory { get; } = ShapeCategory.Effect;
|
||||
|
||||
public abstract void OnDraw(Graphics g);
|
||||
|
||||
public virtual void OnDrawFinal(Graphics g, Bitmap bmp)
|
||||
|
|
|
@ -27,6 +27,6 @@ namespace ShareX.ScreenCaptureLib
|
|||
{
|
||||
public abstract class BaseRegionShape : BaseShape
|
||||
{
|
||||
public override bool IsRegionShape { get; } = true;
|
||||
public override ShapeCategory ShapeCategory { get; } = ShapeCategory.Region;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue