]> granicus.if.org Git - handbrake/commitdiff
WinGui: Additional fixes to the picture settings panel.
authorsr55 <sr55.hb@outlook.com>
Sun, 24 Jun 2012 13:36:41 +0000 (13:36 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 24 Jun 2012 13:36:41 +0000 (13:36 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4774 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs

index 78c2600b2f105c1ad2e5ff35f7a7b0e960cf8007..d68db870b940364a69c49063e3122a9afc3ae140 100644 (file)
@@ -574,20 +574,20 @@ namespace HandBrakeWPF.ViewModels
             this.SelectedAnamorphicMode = preset.Task.Anamorphic;\r
 \r
             // Set the limits on the UI Controls.\r
-            this.MaxWidth = preset.Task.MaxWidth ?? sourceResolution.Width;\r
-            this.MaxHeight = preset.Task.MaxHeight ?? sourceResolution.Height;\r
+            this.MaxWidth = sourceResolution.Width;\r
+            this.MaxHeight = sourceResolution.Height;\r
             this.Task.MaxWidth = preset.Task.MaxWidth;\r
             this.Task.MaxHeight = preset.Task.MaxHeight;\r
 \r
             if (preset.Task.MaxWidth.HasValue)\r
             {\r
-                if (this.Width > this.MaxWidth)\r
+                if (this.Width > preset.Task.MaxWidth)\r
                 {\r
-                    this.Width = this.MaxWidth;\r
+                    this.Width = preset.Task.MaxWidth.Value;\r
                 } \r
                 else\r
                 {\r
-                    this.Width = preset.Task.Width ?? this.getRes((sourceResolution.Width - this.CropLeft - this.CropRight), this.MaxWidth);\r
+                    this.Width = preset.Task.Width ?? this.getRes((sourceResolution.Width - this.CropLeft - this.CropRight), preset.Task.MaxWidth.Value);\r
                 }\r
             } \r
             else\r
@@ -597,19 +597,15 @@ namespace HandBrakeWPF.ViewModels
 \r
             if (preset.Task.MaxHeight.HasValue)\r
             {\r
-                if (this.Height > this.MaxHeight)\r
+                if (this.Height > preset.Task.MaxHeight)\r
                 {\r
-                    this.Height = this.MaxHeight;\r
+                    this.Height = preset.Task.MaxHeight.Value;\r
                 }\r
                 else\r
                 {\r
-                    this.Height = preset.Task.Height ?? this.getRes((sourceResolution.Height - this.CropTop - this.CropBottom), this.MaxHeight);\r
+                    this.Height = preset.Task.Height ?? this.getRes((sourceResolution.Height - this.CropTop - this.CropBottom), preset.Task.MaxHeight.Value);\r
                 }\r
             } \r
-            else\r
-            {\r
-                this.Height = preset.Task.Height ?? (sourceResolution.Height - this.CropTop - this.CropBottom);\r
-            }\r
 \r
             // Anamorphic\r
             if (preset.Task.Anamorphic == Anamorphic.Custom)\r
@@ -619,7 +615,15 @@ namespace HandBrakeWPF.ViewModels
                 this.ParHeight = preset.Task.PixelAspectY;\r
             }\r
 \r
-            this.MaintainAspectRatio = preset.Task.KeepDisplayAspect;\r
+            // Default this to On.\r
+            if (preset.Task.Anamorphic == Anamorphic.None)\r
+            {\r
+                this.MaintainAspectRatio = true;\r
+            }\r
+            else\r
+            {\r
+                this.MaintainAspectRatio = preset.Task.KeepDisplayAspect;\r
+            }\r
 \r
             if (preset.Task.Modulus.HasValue)\r
             {\r