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 584d104
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 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 Down Expand Up @@ -48,16 +49,16 @@ protected override void OnPaint(PaintEventArgs e)
{
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 584d104

Please sign in to comment.