Fix line, arrow anti aliasing issue when doing horizontal or vertical lines

This commit is contained in:
Jaex 2016-09-03 12:06:51 +03:00
parent 84b25135fb
commit 3132461219
2 changed files with 6 additions and 4 deletions

View file

@ -47,12 +47,18 @@ public override void OnDraw(Graphics g)
{ {
g.SmoothingMode = SmoothingMode.HighQuality; g.SmoothingMode = SmoothingMode.HighQuality;
if (BorderSize.IsEvenNumber())
{
g.PixelOffsetMode = PixelOffsetMode.Half;
}
using (Pen pen = new Pen(BorderColor, BorderSize)) using (Pen pen = new Pen(BorderColor, BorderSize))
{ {
DrawLine(g, pen); DrawLine(g, pen);
} }
g.SmoothingMode = SmoothingMode.None; g.SmoothingMode = SmoothingMode.None;
g.PixelOffsetMode = PixelOffsetMode.Default;
} }
} }

View file

@ -23,10 +23,6 @@
#endregion License Information (GPL v3) #endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace ShareX.ScreenCaptureLib namespace ShareX.ScreenCaptureLib
{ {
public class RoundedRectangleDrawingShape : RectangleDrawingShape public class RoundedRectangleDrawingShape : RectangleDrawingShape