aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOdd Stråbø <oddstr13@openshell.no>2021-03-18 23:40:45 +0100
committerOdd Stråbø <oddstr13@openshell.no>2021-04-11 08:21:23 +0200
commitafff226514a6f645a6738f1e407208826b84f1d6 (patch)
treebe2932a117aa0a33648824ab6619613229c776ab
parente57c1655fb2b7d92db33ff3a3b6b09a09b69cf68 (diff)
Apply suggestions from code review
Co-authored-by: Cody Robibero <cody@robibe.ro>
-rw-r--r--MediaBrowser.Model/Drawing/DrawingUtils.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/MediaBrowser.Model/Drawing/DrawingUtils.cs b/MediaBrowser.Model/Drawing/DrawingUtils.cs
index c2a144f81..556792768 100644
--- a/MediaBrowser.Model/Drawing/DrawingUtils.cs
+++ b/MediaBrowser.Model/Drawing/DrawingUtils.cs
@@ -87,8 +87,8 @@ namespace MediaBrowser.Model.Drawing
fillHeight = 1;
}
- double widthRatio = (double)size.Width / (double)fillWidth;
- double heightRatio = (double)size.Height / (double)fillHeight;
+ double widthRatio = size.Width / (double)fillWidth;
+ double heightRatio = size.Height / (double)fillHeight;
double scaleRatio = Math.Min(widthRatio, heightRatio);
// Clamp to current size.
@@ -97,8 +97,8 @@ namespace MediaBrowser.Model.Drawing
return size;
}
- int newWidth = Convert.ToInt32(Math.Ceiling((double)size.Width / scaleRatio));
- int newHeight = Convert.ToInt32(Math.Ceiling((double)size.Height / scaleRatio));
+ int newWidth = Convert.ToInt32(Math.Ceiling(size.Width / scaleRatio));
+ int newHeight = Convert.ToInt32(Math.Ceiling(size.Height / scaleRatio));
return new ImageDimensions(newWidth, newHeight);
}