diff options
author | sr55 <[email protected]> | 2021-03-29 21:08:12 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2021-03-29 21:08:12 +0100 |
commit | 6e4d106cb1f0f4c24451efb90e352e40f7da8d06 (patch) | |
tree | 4aa4311942c9548e0e188d918b2118c010a4617f /win/CS/HandBrakeWPF/Services | |
parent | 3c2bb9cd9c4a734209174a77db4f6a7ba523c3a3 (diff) |
WinGui: Implement the Pad filter in the UI. (For testing - Note, summary, preview and preset support is not implemented yet.)
Diffstat (limited to 'win/CS/HandBrakeWPF/Services')
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs index a5e8d26e8..dee655e15 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs @@ -472,8 +472,18 @@ namespace HandBrakeWPF.Services.Encode.Factories // Padding Filter if (job.Padding.Enabled) - { - string padSettings = string.Format("width={0}:height={1}:color={2}:x={3}:y={4}", job.Width, job.Height, job.Padding.Color, job.Padding.X, job.Padding.Y); + { + // Calculate the new Width / Height + int? width = job.Width; + int? height = job.Height; + if (job.Padding.Enabled) + { + width = width + job.Padding.W; + height = height + job.Padding.H; + } + + // Setup the filter. + string padSettings = string.Format("width={0}:height={1}:color={2}:x={3}:y={4}", width, height, job.Padding.Color, job.Padding.X, job.Padding.Y); string unparsedPadSettingsJson = HandBrakeFilterHelpers.GenerateFilterSettingJson((int)hb_filter_ids.HB_FILTER_PAD, null, null, padSettings); if (!string.IsNullOrEmpty(unparsedPadSettingsJson)) { |