Fix News indicator scaling

This commit is contained in:
SupSuper 2018-04-19 03:06:20 +01:00
parent 52a15de904
commit d58b001d8e

View file

@ -60,7 +60,8 @@ private void UpdateImage()
} }
else else
{ {
Bitmap bmp = new Bitmap(16, 16); int size = Height - ExtraImagePadding * 2;
Bitmap bmp = new Bitmap(size, size);
using (Graphics g = Graphics.FromImage(bmp)) using (Graphics g = Graphics.FromImage(bmp))
using (Brush brush = new SolidBrush(Color.FromArgb(230, 0, 0))) using (Brush brush = new SolidBrush(Color.FromArgb(230, 0, 0)))
@ -69,7 +70,7 @@ private void UpdateImage()
{ {
g.SmoothingMode = SmoothingMode.HighQuality; g.SmoothingMode = SmoothingMode.HighQuality;
g.PixelOffsetMode = PixelOffsetMode.Half; g.PixelOffsetMode = PixelOffsetMode.Half;
g.DrawRoundedRectangle(brush, null, new Rectangle(0, 0, 16, 16), 3); g.DrawRoundedRectangle(brush, null, new Rectangle(0, 0, bmp.Width, bmp.Height), 3);
stringFormat.Alignment = StringAlignment.Center; stringFormat.Alignment = StringAlignment.Center;
stringFormat.LineAlignment = StringAlignment.Center; stringFormat.LineAlignment = StringAlignment.Center;
string text; string text;
@ -81,7 +82,7 @@ private void UpdateImage()
{ {
text = Counter.ToString(); text = Counter.ToString();
} }
g.DrawString(text, font, Brushes.White, new Rectangle(0, 0, 16, 16), stringFormat); g.DrawString(text, font, Brushes.White, new Rectangle(0, 0, bmp.Width, bmp.Height), stringFormat);
} }
if (ExtraImage != null) if (ExtraImage != null)