Only draw two arrows if two arrows not collide with each other to avoid GDI related bug

This commit is contained in:
Jaex 2017-11-09 19:55:37 +03:00
parent 2eab4f214d
commit 69d57b07bd

View file

@ -23,6 +23,7 @@ You should have received a copy of the GNU General Public License
#endregion License Information (GPL v3) #endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
@ -63,7 +64,7 @@ protected override Pen CreatePen(Color borderColor, int borderSize)
Pen pen = new Pen(borderColor, borderSize); Pen pen = new Pen(borderColor, borderSize);
pen.CustomEndCap = lineCap; pen.CustomEndCap = lineCap;
if (ArrowHeadsBothSide) if (ArrowHeadsBothSide && MathHelpers.Distance(StartPosition, EndPosition) > arrowHeight * borderSize * 2)
{ {
pen.CustomStartCap = lineCap; pen.CustomStartCap = lineCap;
} }