From e95a1e43f7bb111a9431ba5b97f3fcd1610a07fa Mon Sep 17 00:00:00 2001 From: sr55 Date: Tue, 1 Jan 2019 15:24:46 +0000 Subject: [PATCH] WinGui: Fix restriction on the picture settings tab after setting a preset. It will use whatever is smaller. Source, or Preset #1773 --- .../HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index 1764a7dac..914d54068 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -653,8 +653,12 @@ namespace HandBrakeWPF.ViewModels } else { - this.MaxWidth = preset.Task.MaxWidth ?? this.sourceResolution.Width; - this.MaxHeight = preset.Task.MaxHeight ?? this.sourceResolution.Height; + + int presetWidth = preset.Task.MaxWidth ?? this.sourceResolution.Width; + int presetHeight = preset.Task.MaxHeight ?? this.sourceResolution.Height; + + this.MaxWidth = presetWidth <= this.sourceResolution.Width ? presetWidth : this.sourceResolution.Width; + this.MaxHeight = presetHeight <= this.sourceResolution.Height ? presetHeight : this.sourceResolution.Height; } // Set the width, then check the height doesn't breach the max height and correct if necessary. -- 2.40.0