Skip to content
Snippets Groups Projects
Verified Commit 05e36dd0 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Make image in overlay fit into viewer again

parent b3c78ea8
No related branches found
No related tags found
No related merge requests found
Pipeline #5660 failed
......@@ -51,8 +51,10 @@ Window {
property int imgSrcWidth: (imageOverlay.originalWidth && imageOverlay.originalWidth > 100) ? imageOverlay.originalWidth : Screen.width
property int imgSrcHeight: imageOverlay.proportionalHeight ? imgSrcWidth * imageOverlay.proportionalHeight : Screen.height
height: imgSrcHeight
width: imgSrcWidth
property double initialScale: Math.min(Window.height/imgSrcHeight, Window.width/imgSrcWidth, 1.0)
height: imgSrcHeight * initialScale
width: imgSrcWidth * initialScale
x: (parent.width - width) / 2
y: (parent.height - height) / 2
......@@ -79,6 +81,11 @@ Window {
play: !Settings.animateImagesOnHover || mouseArea.hovered
eventId: imageOverlay.eventId
}
Text {
anchors.centerIn: parent
text: "Orig width: " + imageOverlay.proportionalHeight
}
onScaleChanged: {
if (scale > 10) scale = 10;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment