mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-05 13:23:03 +02:00
Apply suggestions from code review
Co-authored-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
parent
e57c1655fb
commit
afff226514
|
@ -87,8 +87,8 @@ namespace MediaBrowser.Model.Drawing
|
||||||
fillHeight = 1;
|
fillHeight = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
double widthRatio = (double)size.Width / (double)fillWidth;
|
double widthRatio = size.Width / (double)fillWidth;
|
||||||
double heightRatio = (double)size.Height / (double)fillHeight;
|
double heightRatio = size.Height / (double)fillHeight;
|
||||||
double scaleRatio = Math.Min(widthRatio, heightRatio);
|
double scaleRatio = Math.Min(widthRatio, heightRatio);
|
||||||
|
|
||||||
// Clamp to current size.
|
// Clamp to current size.
|
||||||
|
@ -97,8 +97,8 @@ namespace MediaBrowser.Model.Drawing
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
int newWidth = Convert.ToInt32(Math.Ceiling((double)size.Width / scaleRatio));
|
int newWidth = Convert.ToInt32(Math.Ceiling(size.Width / scaleRatio));
|
||||||
int newHeight = Convert.ToInt32(Math.Ceiling((double)size.Height / scaleRatio));
|
int newHeight = Convert.ToInt32(Math.Ceiling(size.Height / scaleRatio));
|
||||||
|
|
||||||
return new ImageDimensions(newWidth, newHeight);
|
return new ImageDimensions(newWidth, newHeight);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue