Prevent big images from becoming square in overlay

This commit is contained in:
Nicolas Werner 2024-03-05 21:28:48 +01:00
parent 02406bf999
commit c9bcf3a7c0
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -51,8 +51,8 @@ Window {
property int imgSrcWidth: (imageOverlay.originalWidth && imageOverlay.originalWidth > 100) ? imageOverlay.originalWidth : Screen.width property int imgSrcWidth: (imageOverlay.originalWidth && imageOverlay.originalWidth > 100) ? imageOverlay.originalWidth : Screen.width
property int imgSrcHeight: imageOverlay.proportionalHeight ? imgSrcWidth * imageOverlay.proportionalHeight : Screen.height property int imgSrcHeight: imageOverlay.proportionalHeight ? imgSrcWidth * imageOverlay.proportionalHeight : Screen.height
height: Math.min(parent.height || Screen.height, imgSrcHeight) height: imgSrcHeight
width: Math.min(parent.width || Screen.width, imgSrcWidth) width: imgSrcWidth
x: (parent.width - width) / 2 x: (parent.width - width) / 2
y: (parent.height - height) / 2 y: (parent.height - height) / 2