From f02c3260273a09f465c4e7a97d8b90f0f6909734 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 8 May 2014 16:09:53 -0400 Subject: Removed guids from the model project --- MediaBrowser.Model/Drawing/DrawingUtils.cs | 35 +++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'MediaBrowser.Model/Drawing/DrawingUtils.cs') diff --git a/MediaBrowser.Model/Drawing/DrawingUtils.cs b/MediaBrowser.Model/Drawing/DrawingUtils.cs index e95b5e3752..ae483b6f67 100644 --- a/MediaBrowser.Model/Drawing/DrawingUtils.cs +++ b/MediaBrowser.Model/Drawing/DrawingUtils.cs @@ -16,7 +16,12 @@ namespace MediaBrowser.Model.Drawing /// ImageSize. public static ImageSize Scale(double currentWidth, double currentHeight, double scaleFactor) { - return Scale(new ImageSize { Width = currentWidth, Height = currentHeight }, scaleFactor); + return Scale(new ImageSize + { + Width = currentWidth, + Height = currentHeight + + }, scaleFactor); } /// @@ -29,7 +34,7 @@ namespace MediaBrowser.Model.Drawing { var newWidth = size.Width * scaleFactor; - return Resize(size.Width, size.Height, newWidth); + return Resize(size.Width, size.Height, newWidth, null, null, null); } /// @@ -42,9 +47,19 @@ namespace MediaBrowser.Model.Drawing /// A max fixed width, if desired /// A max fixed height, if desired /// ImageSize. - public static ImageSize Resize(double currentWidth, double currentHeight, double? width = null, double? height = null, double? maxWidth = null, double? maxHeight = null) + public static ImageSize Resize(double currentWidth, + double currentHeight, + double? width, + double? height, + double? maxWidth, + double? maxHeight) { - return Resize(new ImageSize { Width = currentWidth, Height = currentHeight }, width, height, maxWidth, maxHeight); + return Resize(new ImageSize + { + Width = currentWidth, + Height = currentHeight + + }, width, height, maxWidth, maxHeight); } /// @@ -56,7 +71,11 @@ namespace MediaBrowser.Model.Drawing /// A max fixed width, if desired /// A max fixed height, if desired /// A new size object - public static ImageSize Resize(ImageSize size, double? width = null, double? height = null, double? maxWidth = null, double? maxHeight = null) + public static ImageSize Resize(ImageSize size, + double? width, + double? height, + double? maxWidth, + double? maxHeight) { double newWidth = size.Width; double newHeight = size.Height; @@ -79,13 +98,13 @@ namespace MediaBrowser.Model.Drawing newWidth = width.Value; } - if (maxHeight.HasValue && maxHeight < newHeight) + if (maxHeight.HasValue && maxHeight.Value < newHeight) { newWidth = GetNewWidth(newHeight, newWidth, maxHeight.Value); newHeight = maxHeight.Value; } - if (maxWidth.HasValue && maxWidth < newWidth) + if (maxWidth.HasValue && maxWidth.Value < newWidth) { newHeight = GetNewHeight(newHeight, newWidth, maxWidth.Value); newWidth = maxWidth.Value; @@ -186,7 +205,7 @@ namespace MediaBrowser.Model.Drawing { if (!string.IsNullOrEmpty(value)) { - var parts = value.Split('-'); + string[] parts = value.Split('-'); if (parts.Length == 2) { -- cgit v1.2.3