From 2d6853029cce7e0787f777f15de39b3e400507aa Mon Sep 17 00:00:00 2001 From: Jaex Date: Mon, 8 Aug 2016 21:31:07 +0300 Subject: [PATCH] Fix rounded rectangle region 1 off issue --- .../Shapes/Drawing/RoundedRectangleDrawingShape.cs | 2 +- .../Shapes/Region/RoundedRectangleRegionShape.cs | 2 +- ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs | 12 ++++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ShareX.ScreenCaptureLib/Shapes/Drawing/RoundedRectangleDrawingShape.cs b/ShareX.ScreenCaptureLib/Shapes/Drawing/RoundedRectangleDrawingShape.cs index 0efc29b92..0dafe49e9 100644 --- a/ShareX.ScreenCaptureLib/Shapes/Drawing/RoundedRectangleDrawingShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/Drawing/RoundedRectangleDrawingShape.cs @@ -77,7 +77,7 @@ public override void OnDraw(Graphics g) public override void OnShapePathRequested(GraphicsPath gp, Rectangle rect) { - gp.AddRoundedRectangle(rect, Radius); + gp.AddRoundedRectangle(rect, Radius, 0); } } } \ No newline at end of file diff --git a/ShareX.ScreenCaptureLib/Shapes/Region/RoundedRectangleRegionShape.cs b/ShareX.ScreenCaptureLib/Shapes/Region/RoundedRectangleRegionShape.cs index 44418e566..f3098de42 100644 --- a/ShareX.ScreenCaptureLib/Shapes/Region/RoundedRectangleRegionShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/Region/RoundedRectangleRegionShape.cs @@ -47,7 +47,7 @@ public override void OnConfigSave() public override void OnShapePathRequested(GraphicsPath gp, Rectangle rect) { - gp.AddRoundedRectangle(rect, Radius); + gp.AddRoundedRectangle(rect, Radius, 0); } } } \ No newline at end of file diff --git a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs index 9cac075b5..6fa10be9e 100644 --- a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs +++ b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs @@ -163,8 +163,16 @@ public bool IsCurrentShapeTypeRegion { get { - return CurrentShapeType == ShapeType.RegionRectangle || CurrentShapeType == ShapeType.RegionRoundedRectangle || CurrentShapeType == ShapeType.RegionEllipse || - CurrentShapeType == ShapeType.RegionFreehand; + switch (CurrentShapeType) + { + case ShapeType.RegionRectangle: + case ShapeType.RegionRoundedRectangle: + case ShapeType.RegionEllipse: + case ShapeType.RegionFreehand: + return true; + } + + return false; } }