瀏覽代碼

Simplify arithmetic

Patrick Barron 5 年之前
父節點
當前提交
87b8a8d7c7
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      Jellyfin.Drawing.Skia/PercentPlayedDrawer.cs

+ 1 - 3
Jellyfin.Drawing.Skia/PercentPlayedDrawer.cs

@@ -27,9 +27,7 @@ namespace Jellyfin.Drawing.Skia
             paint.Style = SKPaintStyle.Fill;
             canvas.DrawRect(SKRect.Create(0, (float)endY - IndicatorHeight, endX, endY), paint);
 
-            double foregroundWidth = endX;
-            foregroundWidth *= percent;
-            foregroundWidth /= 100;
+            double foregroundWidth = (endX * percent) / 100;
 
             paint.Color = SKColor.Parse("#FF00A4DC");
             canvas.DrawRect(SKRect.Create(0, (float)endY - IndicatorHeight, Convert.ToInt32(foregroundWidth), endY), paint);