From 356b12cbbb3b907b560b6217aadb2b75092318d0 Mon Sep 17 00:00:00 2001 From: sr55 Date: Tue, 9 Sep 2014 21:06:30 +0000 Subject: WinGui: Fix an issue loading preset Maximum Width/Height info. This was causing previous preset values to be used when calling the libhb calculation logic, leading to bad values. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6398 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'win/CS/HandBrakeWPF') diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index 7d8bdd51b..e2684047e 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -633,8 +633,12 @@ namespace HandBrakeWPF.ViewModels // Set the Maintain Aspect ratio. this.MaintainAspectRatio = preset.Task.KeepDisplayAspect; + // Set the Maximum so libhb can correctly manage the size. + this.MaxWidth = preset.Task.MaxWidth ?? this.sourceResolution.Width; + this.MaxHeight = preset.Task.MaxHeight ?? this.sourceResolution.Height; + // Set the width, then check the height doesn't breach the max height and correct if necessary. - int width = this.GetModulusValue(this.GetRes((this.sourceResolution.Width - this.CropLeft - this.CropRight), preset.Task.MaxWidth)); + int width = this.GetModulusValue(this.GetRes((this.sourceResolution.Width - this.CropLeft - this.CropRight), preset.Task.MaxWidth)); this.Width = width; // If we have a max height, make sure we havn't breached it. @@ -643,9 +647,6 @@ namespace HandBrakeWPF.ViewModels { this.Height = height; } - - this.MaxWidth = width; - this.MaxHeight = height; break; case PresetPictureSettingsMode.None: // Do Nothing except reset the Max Width/Height -- cgit v1.2.3