Kaynağa Gözat

move a variable out of for loop

dkanada 6 yıl önce
ebeveyn
işleme
47095e6cf8
1 değiştirilmiş dosya ile 5 ekleme ve 3 silme
  1. 5 3
      Jellyfin.Drawing.Skia/StripCollageBuilder.cs

+ 5 - 3
Jellyfin.Drawing.Skia/StripCollageBuilder.cs

@@ -77,12 +77,14 @@ namespace Jellyfin.Drawing.Skia
             {
                 canvas.Clear(SKColors.Black);
 
+                // number of images used in the thumbnail
+                var iCount = 3;
+
                 // determine sizes for each image that will composited into the final image
-                var iSlice = Convert.ToInt32(width * 0.33);
-                int iTrans = Convert.ToInt32(height * 0.25);
+                var iSlice = Convert.ToInt32(width / iCount);
                 int iHeight = Convert.ToInt32(height * 1.00);
                 int imageIndex = 0;
-                for (int i = 0; i < 3; i++)
+                for (int i = 0; i < iCount; i++)
                 {
                     using (var currentBitmap = GetNextValidImage(paths, imageIndex, out int newIndex))
                     {