mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
Fit two digit numbers to step label
This commit is contained in:
parent
c7a7a45fe4
commit
ebdcc7273d
1 changed files with 13 additions and 2 deletions
|
@ -73,9 +73,20 @@ public override void OnDraw(Graphics g)
|
|||
|
||||
if (Rectangle.Width > 20 && Rectangle.Height > 20)
|
||||
{
|
||||
int fontSize = Math.Min(Rectangle.Width, Rectangle.Height) - 10;
|
||||
int offset;
|
||||
|
||||
using (Font font = new Font("Verdana", fontSize, GraphicsUnit.Pixel))
|
||||
if (Number > 9)
|
||||
{
|
||||
offset = 15;
|
||||
}
|
||||
else
|
||||
{
|
||||
offset = 10;
|
||||
}
|
||||
|
||||
int fontSize = Math.Min(Rectangle.Width, Rectangle.Height) - offset;
|
||||
|
||||
using (Font font = new Font("Arial", fontSize, GraphicsUnit.Pixel))
|
||||
using (StringFormat sf = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center })
|
||||
{
|
||||
g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
|
||||
|
|
Loading…
Reference in a new issue