Found some more margins that wouldnt be fixed numbers and made the code more consistent

This commit is contained in:
Mark 2017-10-27 14:12:35 +02:00
parent 6c04a8be5d
commit 334283e893
8 changed files with 24 additions and 27 deletions

View file

@ -17,10 +17,10 @@ Component
}
return (sourceSize.width / sourceSize.height) > (maximumWidth / maximumHeight);
}
property real _width: Math.min(maximumWidth, sourceSize.width)
property real _height: Math.min(maximumHeight, sourceSize.height)
width: proportionalHeight ? _width : sourceSize.width * _height / sourceSize.height
height: !proportionalHeight ? _height : sourceSize.height * _width / sourceSize.width
property real _width: Math.floor(Math.min(maximumWidth, sourceSize.width))
property real _height: Math.floor(Math.min(maximumHeight, sourceSize.height))
width: proportionalHeight ? _width : Math.floor(sourceSize.width * _height / sourceSize.height)
height: !proportionalHeight ? _height : Math.floor(sourceSize.height * _width / sourceSize.width)
anchors.horizontalCenter: parent.horizontalCenter
onVisibleChanged: