mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Only allow selection and moving shapes if current shape is same as selected shape that way you can do region capture top of drawings without select drawing shape
This commit is contained in:
parent
a568e98617
commit
09fdffc32d
9 changed files with 17 additions and 1 deletions
|
@ -440,7 +440,7 @@ private void RegionSelection(Point location)
|
|||
|
||||
PositionOnClick = InputManager.MousePosition0Based;
|
||||
|
||||
if (shape != null) // Select area
|
||||
if (shape != null && shape.ShapeType == CurrentShapeType) // Select area
|
||||
{
|
||||
IsMoving = true;
|
||||
CurrentShape = shape;
|
||||
|
|
|
@ -31,6 +31,8 @@ namespace ShareX.ScreenCaptureLib
|
|||
{
|
||||
public abstract class BaseShape
|
||||
{
|
||||
public abstract ShapeType ShapeType { get; }
|
||||
|
||||
public Rectangle Rectangle { get; set; }
|
||||
|
||||
public BaseShape()
|
||||
|
|
|
@ -34,6 +34,8 @@ namespace ShareX.ScreenCaptureLib
|
|||
{
|
||||
public class RectangleDrawingShape : BaseDrawingShape
|
||||
{
|
||||
public override ShapeType ShapeType { get; } = ShapeType.DrawingRectangle;
|
||||
|
||||
public override void Draw(Graphics g)
|
||||
{
|
||||
if (FillColor != Color.Transparent)
|
||||
|
|
|
@ -34,6 +34,8 @@ namespace ShareX.ScreenCaptureLib
|
|||
{
|
||||
public class RoundedRectangleDrawingShape : BaseDrawingShape
|
||||
{
|
||||
public override ShapeType ShapeType { get; } = ShapeType.DrawingRoundedRectangle;
|
||||
|
||||
public float Radius { get; set; }
|
||||
|
||||
public override void Draw(Graphics g)
|
||||
|
|
|
@ -35,6 +35,8 @@ namespace ShareX.ScreenCaptureLib
|
|||
{
|
||||
public class DiamondRegionShape : BaseRegionShape
|
||||
{
|
||||
public override ShapeType ShapeType { get; } = ShapeType.RegionDiamond;
|
||||
|
||||
public override void AddShapePath(GraphicsPath gp, Rectangle rect)
|
||||
{
|
||||
gp.AddDiamond(rect);
|
||||
|
|
|
@ -34,6 +34,8 @@ namespace ShareX.ScreenCaptureLib
|
|||
{
|
||||
public class EllipseRegionShape : BaseRegionShape
|
||||
{
|
||||
public override ShapeType ShapeType { get; } = ShapeType.RegionEllipse;
|
||||
|
||||
public override void AddShapePath(GraphicsPath gp, Rectangle rect)
|
||||
{
|
||||
gp.AddEllipse(rect);
|
||||
|
|
|
@ -34,6 +34,8 @@ namespace ShareX.ScreenCaptureLib
|
|||
{
|
||||
public class RectangleRegionShape : BaseRegionShape
|
||||
{
|
||||
public override ShapeType ShapeType { get; } = ShapeType.RegionRectangle;
|
||||
|
||||
public override void AddShapePath(GraphicsPath gp, Rectangle rect)
|
||||
{
|
||||
gp.AddRectangle(rect);
|
||||
|
|
|
@ -35,6 +35,8 @@ namespace ShareX.ScreenCaptureLib
|
|||
{
|
||||
public class RoundedRectangleRegionShape : BaseRegionShape
|
||||
{
|
||||
public override ShapeType ShapeType { get; } = ShapeType.RegionRoundedRectangle;
|
||||
|
||||
public float Radius { get; set; }
|
||||
|
||||
public override void AddShapePath(GraphicsPath gp, Rectangle rect)
|
||||
|
|
|
@ -35,6 +35,8 @@ namespace ShareX.ScreenCaptureLib
|
|||
{
|
||||
public class TriangleRegionShape : BaseRegionShape
|
||||
{
|
||||
public override ShapeType ShapeType { get; } = ShapeType.RegionTriangle;
|
||||
|
||||
public TriangleAngle Angle { get; set; }
|
||||
|
||||
public override void AddShapePath(GraphicsPath gp, Rectangle rect)
|
||||
|
|
Loading…
Reference in a new issue