diff options
author | sr55 <[email protected]> | 2016-12-10 20:57:18 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2016-12-10 20:57:18 +0000 |
commit | 5fad4b45d7dfee9ac086ee20b08509d3d1c9f315 (patch) | |
tree | e178615a8cf9f0c26f3837b7e814d24cbfca3a2f /win/CS/HandBrakeWPF/ViewModels | |
parent | 81f0ddb2ffbe50901a6825aa932036ebb7ee4d47 (diff) |
WinGui: Further fixes to handle the new "Automatic" anamorphic.. This should fix the case where Selecting a downscaled preset, then selecting a non downscaled preset would result in the Height not being recalculated. For now I've also disabled "Custom" anamorphic as it's quite badly broken until it can be re-worked. Fixes #415
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index e44c0d9d1..35260356f 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -146,7 +146,7 @@ namespace HandBrakeWPF.ViewModels {
get
{
- return new List<Anamorphic> { Anamorphic.None, Anamorphic.Automatic, Anamorphic.Loose, Anamorphic.Custom };
+ return new List<Anamorphic> { Anamorphic.None, Anamorphic.Automatic, Anamorphic.Loose }; // , Anamorphic.Custom TODO Re-enable one the UI is re-worked.
}
}
@@ -643,15 +643,20 @@ namespace HandBrakeWPF.ViewModels }
// 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));
- this.Width = width;
-
- // If we have a max height, make sure we havn't breached it.
+ int width = this.GetModulusValue(this.GetRes((this.sourceResolution.Width - this.CropLeft - this.CropRight), preset.Task.MaxWidth));
int height = this.GetModulusValue(this.GetRes((this.sourceResolution.Height - this.CropTop - this.CropBottom), preset.Task.MaxHeight));
- if (preset.Task.MaxHeight.HasValue && this.Height > preset.Task.MaxHeight.Value)
- {
- this.Height = height;
- }
+
+ // Set the backing fields to avoid triggering recalulation until both are set.
+ this.Task.Width = width;
+ this.Task.Height = height;
+
+ // Trigger a Recalc
+ this.RecaulcatePictureSettingsProperties(ChangedPictureField.Width);
+
+ // Update the UI
+ this.NotifyOfPropertyChange(() => this.Width);
+ this.NotifyOfPropertyChange(() => this.Height);
+
break;
case PresetPictureSettingsMode.None:
// Do Nothing except reset the Max Width/Height
@@ -936,7 +941,7 @@ namespace HandBrakeWPF.ViewModels double dispWidth = Math.Round((result.OutputWidth * result.OutputParWidth / result.OutputParHeight), 0);
this.DisplaySize = this.sourceResolution == null || this.sourceResolution.IsEmpty
? string.Empty
- : string.Format(Resources.PictureSettingsViewModel_StorageDisplayLabel, result.OutputWidth, result.OutputHeight, dispWidth, result.OutputHeight);
+ : string.Format(Resources.PictureSettingsViewModel_StorageDisplayLabel, dispWidth, result.OutputHeight, this.ParWidth, this.ParHeight);
// Step 4, Force an update on all the UI elements.
this.NotifyOfPropertyChange(() => this.Width);
@@ -979,7 +984,7 @@ namespace HandBrakeWPF.ViewModels this.WidthControlEnabled = true;
this.HeightControlEnabled = true;
this.ShowCustomAnamorphicControls = false;
- this.ShowModulus = false;
+ this.ShowModulus = true;
this.ShowKeepAR = false;
break;
|