From 99c35442c9c104e83b9b20624bfaf02fc5813f68 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 24 Mar 2019 21:45:13 +0000 Subject: [PATCH] WinGui: Fix an issue where cropping was taking into account too late when loading presets. Fixes #2007 --- .../ViewModels/PictureSettingsViewModel.cs | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index 914d54068..3ee12fa6d 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -626,6 +626,26 @@ namespace HandBrakeWPF.ViewModels preset.PictureSettingsMode = PresetPictureSettingsMode.Custom; } + // Cropping + if (preset.Task.HasCropping) + { + this.IsCustomCrop = true; + this.Task.Cropping.Left = preset.Task.Cropping.Left; + this.Task.Cropping.Right = preset.Task.Cropping.Right; + this.Task.Cropping.Top = preset.Task.Cropping.Top; + this.Task.Cropping.Bottom = preset.Task.Cropping.Bottom; + + this.NotifyOfPropertyChange(() => this.CropLeft); + this.NotifyOfPropertyChange(() => this.CropRight); + this.NotifyOfPropertyChange(() => this.CropTop); + this.NotifyOfPropertyChange(() => this.CropBottom); + } + else + { + this.IsCustomCrop = false; + } + + // Setup the Picture Sizes switch (preset.PictureSettingsMode) { @@ -701,20 +721,6 @@ namespace HandBrakeWPF.ViewModels this.ParHeight = preset.Task.PixelAspectY; } - // Cropping - if (preset.Task.HasCropping) - { - this.IsCustomCrop = true; - this.CropLeft = preset.Task.Cropping.Left; - this.CropRight = preset.Task.Cropping.Right; - this.CropTop = preset.Task.Cropping.Top; - this.CropBottom = preset.Task.Cropping.Bottom; - } - else - { - this.IsCustomCrop = false; - } - this.NotifyOfPropertyChange(() => this.Task); this.UpdateVisibileControls(); -- 2.40.0