Skip to content

Commit

Permalink
review: switch to full circle
Browse files Browse the repository at this point in the history
  • Loading branch information
Vertygo committed Oct 2, 2024
1 parent bc48eac commit dd383c8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ShareX.HelpersLib/Input/MouseClickEffectForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public MouseClickEffectForm()
AllowTransparency = true;
BackColor = Color.White; // Set a key color for transparency
TransparencyKey = Color.White; // Make that color transparent
Opacity = 0.3;
}

/// <summary>
Expand All @@ -40,24 +41,24 @@ public void ClearMouseEffect()
}

/// <summary>
/// Draw a hollow circle as an mouse effect
/// Draw a circle as an mouse effect
/// </summary>
protected override void OnPaint(PaintEventArgs e)
{
if (_drawEffect)
{
Graphics g = e.Graphics;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
// Define a pen to draw hollow circle
Pen pen = new Pen(Color.Red, 3);
int diameter = 10;
// Define a brush to draw circle
Brush brush = new SolidBrush(Color.Red);
int diameter = 20;

// Calculate the top-left corner to center the circle
int x = (ClientSize.Width - diameter) / 2;
int y = (ClientSize.Height - diameter) / 2;

// .NET GDI+ is not precise when drawign circles this would be better off with WPF/vector-based drawing
g.DrawEllipse(pen, x, y, diameter, diameter);
g.FillEllipse(brush, x, y, diameter, diameter);
}

base.OnPaint(e);
Expand Down

0 comments on commit dd383c8

Please sign in to comment.