} \r
\r
// Set the width, then check the height doesn't breach the max height and correct if necessary.\r
- int width = this.GetModulusValue(this.GetRes((this.sourceResolution.Width - this.CropLeft - this.CropRight), preset.Task.MaxWidth));\r
- int height = this.GetModulusValue(this.GetRes((this.sourceResolution.Height - this.CropTop - this.CropBottom), preset.Task.MaxHeight));\r
+ int width = this.GetModulusValue(this.GetRes((this.sourceResolution.Width - this.CropLeft - this.CropRight), this.MaxWidth));\r
+ int height = this.GetModulusValue(this.GetRes((this.sourceResolution.Height - this.CropTop - this.CropBottom), this.MaxHeight));\r
\r
// Set the backing fields to avoid triggering recalulation until both are set.\r
this.Task.Width = width;\r
this.MaxWidth = this.sourceResolution.Width;\r
this.MaxHeight = this.sourceResolution.Height;\r
this.SelectedAnamorphicMode = preset.Task.Anamorphic;\r
+\r
+ if (this.Width > this.MaxWidth)\r
+ {\r
+ // Trigger a Recalc\r
+ this.Task.Width = this.GetModulusValue(this.GetRes((this.sourceResolution.Width - this.CropLeft - this.CropRight), this.MaxWidth));\r
+ this.RecaulcatePictureSettingsProperties(ChangedPictureField.Width);\r
+ }\r
+\r
break;\r
}\r
\r
this.IsCustomCrop = true;\r
}\r
\r
+ // Set the Max Width / Height available to the user controls.\r
+ // Preset Max is null for None / SourceMax\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
+\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
+\r
+ // Set the W/H\r
if (preset.PictureSettingsMode == PresetPictureSettingsMode.None)\r
{\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
+ else if (preset.PictureSettingsMode == PresetPictureSettingsMode.SourceMaximum)\r
+ {\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 = preset.Task.KeepDisplayAspect;\r
+ }\r
+ else // Custom\r
{\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
-\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
-\r
// Set the Width, and Maintain Aspect ratio. That should calc the Height for us.\r
- if (this.SelectedAnamorphicMode == Anamorphic.None)\r
+ this.Task.Width = this.GetModulusValue(this.MaxWidth - this.CropLeft - this.CropRight);\r
+\r
+ if (this.SelectedAnamorphicMode != Anamorphic.Loose)\r
{\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
- {\r
- this.Task.Width = preset.Task.Width ?? this.MaxWidth;\r
-\r
- int cropHeight = this.Task.Cropping.Top + this.Task.Cropping.Bottom;\r
- this.Task.Height = (preset.Task.Height ?? this.MaxHeight) - cropHeight;\r
}\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