]> granicus.if.org Git - handbrake/commitdiff
WinGui: Further Fixes to the Picture Settings screen when handling new sources.
authorsr55 <sr55.hb@outlook.com>
Sat, 10 Dec 2016 21:13:00 +0000 (21:13 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 10 Dec 2016 21:13:00 +0000 (21:13 +0000)
win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs

index 35260356fea684b5f66cde947addb426fb243937..e4e8e0075fde1eb3dfe2fe9bfced858c730216c8 100644 (file)
@@ -758,33 +758,29 @@ namespace HandBrakeWPF.ViewModels
                 {\r
                     // We have no instructions, so simply set it to the source.\r
                     this.Task.Width = this.GetModulusValue(this.sourceResolution.Width - this.CropLeft - this.CropRight);\r
+                    this.Task.Height = this.GetModulusValue(this.sourceResolution.Height - this.CropTop - this.CropBottom);\r
                     this.MaintainAspectRatio = true;\r
                 }\r
                 else\r
                 {\r
-                    // Set the Max Width / Height available to the user controls\r
+                    // Set the Max Width / Height available to the user controls.\r
+                    this.MaxWidth = preset.Task.MaxWidth ?? this.sourceResolution.Width;\r
                     if (this.sourceResolution.Width < this.MaxWidth)\r
                     {\r
                         this.MaxWidth = this.sourceResolution.Width;\r
                     }\r
-                    else if (this.sourceResolution.Width > this.MaxWidth)\r
-                    {\r
-                        this.MaxWidth = preset.Task.MaxWidth ?? this.sourceResolution.Width;\r
-                    }\r
 \r
+                    this.MaxHeight = preset.Task.MaxHeight ?? this.sourceResolution.Height;\r
                     if (this.sourceResolution.Height < this.MaxHeight)\r
                     {\r
                         this.MaxHeight = this.sourceResolution.Height;\r
                     }\r
-                    else if (this.sourceResolution.Height > this.MaxHeight)\r
-                    {\r
-                        this.MaxHeight = preset.Task.MaxHeight ?? this.sourceResolution.Height;\r
-                    }\r
 \r
                     // Set the Width, and Maintain Aspect ratio. That should calc the Height for us.\r
                     if (this.SelectedAnamorphicMode == Anamorphic.None)\r
                     {\r
-                        this.Task.Width = preset.Task.Width ?? (this.MaxWidth - this.CropLeft - this.CropRight);\r
+                        this.Task.Width = preset.Task.Width ?? this.GetModulusValue(this.MaxWidth - this.CropLeft - this.CropRight);\r
+                        this.Task.Height = this.GetModulusValue(this.MaxHeight - this.CropTop - this.CropBottom);\r
                         // Note: This will be auto-corrected in the property if it's too large.\r
                     }\r
                     else\r