From 7e1d3dc3448805803138cb4fe4ad1e1c8d6f1c85 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 24 Jun 2012 13:36:41 +0000 Subject: WinGui: Additional fixes to the picture settings panel. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4774 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../ViewModels/PictureSettingsViewModel.cs | 30 ++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index 78c2600b2..d68db870b 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -574,20 +574,20 @@ namespace HandBrakeWPF.ViewModels this.SelectedAnamorphicMode = preset.Task.Anamorphic; // Set the limits on the UI Controls. - this.MaxWidth = preset.Task.MaxWidth ?? sourceResolution.Width; - this.MaxHeight = preset.Task.MaxHeight ?? sourceResolution.Height; + this.MaxWidth = sourceResolution.Width; + this.MaxHeight = sourceResolution.Height; this.Task.MaxWidth = preset.Task.MaxWidth; this.Task.MaxHeight = preset.Task.MaxHeight; if (preset.Task.MaxWidth.HasValue) { - if (this.Width > this.MaxWidth) + if (this.Width > preset.Task.MaxWidth) { - this.Width = this.MaxWidth; + this.Width = preset.Task.MaxWidth.Value; } else { - this.Width = preset.Task.Width ?? this.getRes((sourceResolution.Width - this.CropLeft - this.CropRight), this.MaxWidth); + this.Width = preset.Task.Width ?? this.getRes((sourceResolution.Width - this.CropLeft - this.CropRight), preset.Task.MaxWidth.Value); } } else @@ -597,19 +597,15 @@ namespace HandBrakeWPF.ViewModels if (preset.Task.MaxHeight.HasValue) { - if (this.Height > this.MaxHeight) + if (this.Height > preset.Task.MaxHeight) { - this.Height = this.MaxHeight; + this.Height = preset.Task.MaxHeight.Value; } else { - this.Height = preset.Task.Height ?? this.getRes((sourceResolution.Height - this.CropTop - this.CropBottom), this.MaxHeight); + this.Height = preset.Task.Height ?? this.getRes((sourceResolution.Height - this.CropTop - this.CropBottom), preset.Task.MaxHeight.Value); } } - else - { - this.Height = preset.Task.Height ?? (sourceResolution.Height - this.CropTop - this.CropBottom); - } // Anamorphic if (preset.Task.Anamorphic == Anamorphic.Custom) @@ -619,7 +615,15 @@ namespace HandBrakeWPF.ViewModels this.ParHeight = preset.Task.PixelAspectY; } - this.MaintainAspectRatio = preset.Task.KeepDisplayAspect; + // Default this to On. + if (preset.Task.Anamorphic == Anamorphic.None) + { + this.MaintainAspectRatio = true; + } + else + { + this.MaintainAspectRatio = preset.Task.KeepDisplayAspect; + } if (preset.Task.Modulus.HasValue) { -- cgit v1.2.3