]> granicus.if.org Git - handbrake/commitdiff
WinGui: Fix restriction on the picture settings tab after setting a preset. It...
authorsr55 <sr55.hb@outlook.com>
Tue, 1 Jan 2019 15:24:46 +0000 (15:24 +0000)
committersr55 <sr55.hb@outlook.com>
Tue, 1 Jan 2019 15:24:46 +0000 (15:24 +0000)
win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs

index 1764a7dac9db1947da52f016df5eb70425c1a6f7..914d540682bc52fbd499e6447cd8f43cd34c736a 100644 (file)
@@ -653,8 +653,12 @@ namespace HandBrakeWPF.ViewModels
                     }\r
                     else\r
                     {\r
-                        this.MaxWidth = preset.Task.MaxWidth ?? this.sourceResolution.Width;\r
-                        this.MaxHeight = preset.Task.MaxHeight ?? this.sourceResolution.Height;                        \r
+\r
+                        int presetWidth = preset.Task.MaxWidth ?? this.sourceResolution.Width;\r
+                        int presetHeight = preset.Task.MaxHeight ?? this.sourceResolution.Height;\r
+\r
+                        this.MaxWidth = presetWidth <= this.sourceResolution.Width ? presetWidth : this.sourceResolution.Width;\r
+                        this.MaxHeight = presetHeight <= this.sourceResolution.Height ? presetHeight : this.sourceResolution.Height;                        \r
                     }             \r
 \r
                     // Set the width, then check the height doesn't breach the max height and correct if necessary.\r