From 589f9f88a373755530aad5e537556e8186c3215b Mon Sep 17 00:00:00 2001 From: James Graham Date: Mon, 10 Oct 2022 19:27:02 +0100 Subject: [PATCH] Handle images with size (0,0) in fullscreen mode --- imports/NeoChat/Component/FullScreenImage.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imports/NeoChat/Component/FullScreenImage.qml b/imports/NeoChat/Component/FullScreenImage.qml index 48cc9dcc2..1f8b4743c 100644 --- a/imports/NeoChat/Component/FullScreenImage.qml +++ b/imports/NeoChat/Component/FullScreenImage.qml @@ -209,8 +209,8 @@ Popup { property var scaleFactor: 1 property int rotationAngle: 0 - property var rotationInsensitiveWidth: Math.min(root.imageWidth !== -1 ? root.imageWidth : sourceSize.width, imageContainer.width - Kirigami.Units.largeSpacing * 2) - property var rotationInsensitiveHeight: Math.min(root.imageHeight !== -1 ? root.imageHeight : sourceSize.height, imageContainer.height - Kirigami.Units.largeSpacing * 2) + property var rotationInsensitiveWidth: Math.min(root.imageWidth > 0 ? root.imageWidth : sourceSize.width, imageContainer.width - Kirigami.Units.largeSpacing * 2) + property var rotationInsensitiveHeight: Math.min(root.imageHeight > 0 ? root.imageHeight : sourceSize.height, imageContainer.height - Kirigami.Units.largeSpacing * 2) anchors.centerIn: parent width: rotationAngle % 180 === 0 ? rotationInsensitiveWidth : rotationInsensitiveHeight