aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Drawing.Skia/UnplayedCountIndicator.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-08-18 20:20:32 -0600
committercrobibero <cody@robibe.ro>2020-08-18 20:20:32 -0600
commitb43a8fb9d35846f458212d0ad17f3d52c896ef6e (patch)
tree339a40a3e2f2ee73a0ed73cef66fd4bc7c553fb9 /Jellyfin.Drawing.Skia/UnplayedCountIndicator.cs
parent2b5d515de79f2309219459c7223b8a56269737f8 (diff)
parent93fe595e5e9863874c1973e4f2d7f3c85549d3f9 (diff)
Merge remote-tracking branch 'upstream/master' into package-install-repo
Diffstat (limited to 'Jellyfin.Drawing.Skia/UnplayedCountIndicator.cs')
-rw-r--r--Jellyfin.Drawing.Skia/UnplayedCountIndicator.cs52
1 files changed, 24 insertions, 28 deletions
diff --git a/Jellyfin.Drawing.Skia/UnplayedCountIndicator.cs b/Jellyfin.Drawing.Skia/UnplayedCountIndicator.cs
index cf3dbde2c..58f887c96 100644
--- a/Jellyfin.Drawing.Skia/UnplayedCountIndicator.cs
+++ b/Jellyfin.Drawing.Skia/UnplayedCountIndicator.cs
@@ -28,41 +28,37 @@ namespace Jellyfin.Drawing.Skia
var x = imageSize.Width - OffsetFromTopRightCorner;
var text = count.ToString(CultureInfo.InvariantCulture);
- using (var paint = new SKPaint())
+ using var paint = new SKPaint
{
- paint.Color = SKColor.Parse("#CC00A4DC");
- paint.Style = SKPaintStyle.Fill;
- canvas.DrawCircle(x, OffsetFromTopRightCorner, 20, paint);
- }
-
- using (var paint = new SKPaint())
- {
- paint.Color = new SKColor(255, 255, 255, 255);
- paint.Style = SKPaintStyle.Fill;
+ Color = SKColor.Parse("#CC00A4DC"),
+ Style = SKPaintStyle.Fill
+ };
- paint.TextSize = 24;
- paint.IsAntialias = true;
+ canvas.DrawCircle(x, OffsetFromTopRightCorner, 20, paint);
- var y = OffsetFromTopRightCorner + 9;
+ paint.Color = new SKColor(255, 255, 255, 255);
+ paint.TextSize = 24;
+ paint.IsAntialias = true;
- if (text.Length == 1)
- {
- x -= 7;
- }
+ var y = OffsetFromTopRightCorner + 9;
- if (text.Length == 2)
- {
- x -= 13;
- }
- else if (text.Length >= 3)
- {
- x -= 15;
- y -= 2;
- paint.TextSize = 18;
- }
+ if (text.Length == 1)
+ {
+ x -= 7;
+ }
- canvas.DrawText(text, x, y, paint);
+ if (text.Length == 2)
+ {
+ x -= 13;
+ }
+ else if (text.Length >= 3)
+ {
+ x -= 15;
+ y -= 2;
+ paint.TextSize = 18;
}
+
+ canvas.DrawText(text, x, y, paint);
}
}
}