From e14b6f20ea3b656f112d518e006024da0fe1a5dc Mon Sep 17 00:00:00 2001 From: Jaex Date: Thu, 25 Aug 2016 02:57:02 +0300 Subject: [PATCH] Fix border issue --- .../Drawing/SpeechBalloonDrawingShape.cs | 53 +++++++++++-------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/ShareX.ScreenCaptureLib/Shapes/Drawing/SpeechBalloonDrawingShape.cs b/ShareX.ScreenCaptureLib/Shapes/Drawing/SpeechBalloonDrawingShape.cs index d4efd9000..5d67c6afd 100644 --- a/ShareX.ScreenCaptureLib/Shapes/Drawing/SpeechBalloonDrawingShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/Drawing/SpeechBalloonDrawingShape.cs @@ -60,29 +60,7 @@ public override void OnDraw(Graphics g) if (!Rectangle.Contains(TailNode.Position)) { - g.SmoothingMode = SmoothingMode.HighQuality; - g.ExcludeClip(Rectangle); - gpTail = CreateTailPath(TailWidth); - - if (FillColor.A > 0) - { - using (Brush brush = new SolidBrush(FillColor)) - { - g.FillPath(brush, gpTail); - } - } - - if (BorderSize > 0 && BorderColor.A > 0) - { - using (Pen pen = new Pen(BorderColor, BorderSize)) - { - g.DrawPath(pen, gpTail); - } - } - - g.SmoothingMode = SmoothingMode.None; - g.ResetClip(); } if (FillColor.A > 0) @@ -93,6 +71,37 @@ public override void OnDraw(Graphics g) } } + if (gpTail != null) + { + g.SmoothingMode = SmoothingMode.HighQuality; + + if (FillColor.A > 0) + { + g.ExcludeClip(Rectangle); + + using (Brush brush = new SolidBrush(FillColor)) + { + g.FillPath(brush, gpTail); + } + + g.ResetClip(); + } + + if (BorderSize > 0 && BorderColor.A > 0) + { + g.ExcludeClip(Rectangle.Offset(-1)); + + using (Pen pen = new Pen(BorderColor, BorderSize)) + { + g.DrawPath(pen, gpTail); + } + + g.ResetClip(); + } + + g.SmoothingMode = SmoothingMode.None; + } + if (BorderSize > 0 && BorderColor.A > 0) { if (gpTail != null)