|
|
@@ -58,22 +58,49 @@ namespace PicView.Core.Calculations
|
|
|
}
|
|
|
else if (SettingsHelper.Settings.WindowProperties.AutoFit)
|
|
|
{
|
|
|
- maxWidth = SettingsHelper.Settings.ImageScaling.StretchImage
|
|
|
- ? workAreaWidth - padding
|
|
|
- : Math.Min(workAreaWidth - padding, width);
|
|
|
- maxHeight = SettingsHelper.Settings.ImageScaling.StretchImage
|
|
|
- ? workAreaHeight - padding
|
|
|
- : Math.Min(workAreaHeight - padding, height);
|
|
|
+ if (rotationAngle is 90 or 270)
|
|
|
+ {
|
|
|
+ maxWidth = SettingsHelper.Settings.ImageScaling.StretchImage
|
|
|
+ ? workAreaHeight - padding
|
|
|
+ : Math.Min(workAreaHeight - padding, height);
|
|
|
+
|
|
|
+ maxHeight = SettingsHelper.Settings.ImageScaling.StretchImage
|
|
|
+ ? workAreaWidth - padding
|
|
|
+ : Math.Min(workAreaWidth - padding, width);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ maxWidth = SettingsHelper.Settings.ImageScaling.StretchImage
|
|
|
+ ? workAreaWidth - padding
|
|
|
+ : Math.Min(workAreaWidth - padding, width);
|
|
|
+
|
|
|
+ maxHeight = SettingsHelper.Settings.ImageScaling.StretchImage
|
|
|
+ ? workAreaHeight - padding
|
|
|
+ : Math.Min(workAreaHeight - padding, height);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- maxWidth = SettingsHelper.Settings.ImageScaling.StretchImage
|
|
|
- ? containerWidth
|
|
|
- : Math.Min(containerWidth, width);
|
|
|
+ if (rotationAngle is 90 or 270)
|
|
|
+ {
|
|
|
+ maxWidth = SettingsHelper.Settings.ImageScaling.StretchImage
|
|
|
+ ? containerHeight - galleryHeight
|
|
|
+ : height;
|
|
|
|
|
|
- maxHeight = SettingsHelper.Settings.ImageScaling.StretchImage
|
|
|
- ? containerHeight - galleryHeight
|
|
|
- : Math.Min(containerHeight - galleryHeight, height);
|
|
|
+ maxHeight = SettingsHelper.Settings.ImageScaling.StretchImage
|
|
|
+ ? containerHeight - galleryHeight
|
|
|
+ : Math.Min(containerHeight, height);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ maxWidth = SettingsHelper.Settings.ImageScaling.StretchImage
|
|
|
+ ? containerWidth
|
|
|
+ : Math.Min(containerWidth, width);
|
|
|
+
|
|
|
+ maxHeight = SettingsHelper.Settings.ImageScaling.StretchImage
|
|
|
+ ? containerHeight - galleryHeight
|
|
|
+ : Math.Min(containerHeight - galleryHeight, height);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (SettingsHelper.Settings.Gallery.IsBottomGalleryShown)
|