diff options
author | sr55 <[email protected]> | 2014-09-09 21:06:30 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2014-09-09 21:06:30 +0000 |
commit | 356b12cbbb3b907b560b6217aadb2b75092318d0 (patch) | |
tree | cc99ea8a3ee15986893bdd53208459605e03f8e3 /win | |
parent | 47f221161b42b7d3cb1ae49a16a6ec7452eb978f (diff) |
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
Diffstat (limited to 'win')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs | 9 |
1 files changed, 5 insertions, 4 deletions
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
|