]> granicus.if.org Git - handbrake/commitdiff
WinGui: Fixes to Anamorphic handling on the picture tab and in static preview #1169
authorsr55 <sr55.hb@outlook.com>
Sat, 10 Feb 2018 20:41:30 +0000 (20:41 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 10 Feb 2018 20:41:30 +0000 (20:41 +0000)
win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs
win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs

index 3081faf246c83b19f906d0ad759a9986f7682965..e398edda26eef6f3a396eeea3a21ae2532e21ddd 100644 (file)
@@ -305,7 +305,7 @@ namespace HandBrake.ApplicationServices.Interop
                 {\r
                     height = settings.Height,\r
                     width = settings.Width,\r
-                    par = settings.Anamorphic != Anamorphic.Custom\r
+                    par = settings.Anamorphic != Anamorphic.Custom && settings.Anamorphic != Anamorphic.Automatic\r
                         ? new hb_rational_t { den = title.Geometry.PAR.Den, num = title.Geometry.PAR.Num }\r
                         : new hb_rational_t { den = settings.PixelAspectY, num = settings.PixelAspectX }\r
                 }\r
index 828ddfe19c9219508964079ecfb7aae18d4a7ed7..4474938c50fc734c191cc9b22b8c0478dc5f1530 100644 (file)
@@ -807,17 +807,11 @@ namespace HandBrakeWPF.ViewModels
                 {\r
                     // Custom\r
                     // Set the Width, and Maintain Aspect ratio. That should calc the Height for us.\r
-                    this.Task.Width = this.GetModulusValue(this.MaxWidth - this.CropLeft - this.CropRight);\r
-\r
+                    this.Task.Width = this.GetModulusValue(this.sourceResolution.Width - this.CropLeft - this.CropRight);\r
+           \r
                     if (this.SelectedAnamorphicMode != Anamorphic.Loose)\r
                     {\r
-                        this.Task.Height = this.GetModulusValue(this.MaxHeight - this.CropTop - this.CropBottom);\r
-                    }\r
\r
-                    // If our height is too large, let it downscale the width for us by setting the height to the lower value.\r
-                    if (!this.MaintainAspectRatio && this.Height > this.MaxHeight)\r
-                    {\r
-                        this.Task.Height = this.MaxHeight;\r
+                        this.Task.Height = this.GetModulusValue(this.sourceResolution.Height - this.CropTop - this.CropBottom);\r
                     }\r
                 }\r
 \r
@@ -829,6 +823,7 @@ namespace HandBrakeWPF.ViewModels
                     title.ParVal.Width,\r
                     title.ParVal.Height);\r
 \r
+                // Force a re-calc. This will handle MaxWidth / Height corrections.\r
                 this.RecaulcatePictureSettingsProperties(ChangedPictureField.Width);\r
             }\r
 \r
@@ -912,7 +907,7 @@ namespace HandBrakeWPF.ViewModels
                 ParH = this.ParHeight,\r
                 MaxWidth = this.MaxWidth,\r
                 MaxHeight = this.MaxHeight,\r
-                KeepDisplayAspect = this.MaintainAspectRatio,\r
+                KeepDisplayAspect = false, //this.MaintainAspectRatio,\r
                 AnamorphicMode = this.SelectedAnamorphicMode,\r
                 Crop = new Cropping(this.CropTop, this.CropBottom, this.CropLeft, this.CropRight),\r
             };\r