mirror of https://github.com/status-im/StatusQ.git
fix(StatusRoundedImage): actual loaded image width and height updated
In case you're dynamically change source image and image width and height are way bigger than the rounded image component width and height, resizing was not done correctly. update update
This commit is contained in:
parent
24228c5568
commit
be0f49a8d8
|
@ -28,11 +28,19 @@ Rectangle {
|
|||
id: image
|
||||
width: statusRoundImage.width
|
||||
height: statusRoundImage.height
|
||||
sourceSize.width: parent.width * 2
|
||||
sourceSize.height: parent.height * 2
|
||||
fillMode: Image.PreserveAspectFit
|
||||
anchors.centerIn: parent
|
||||
cache: true
|
||||
|
||||
onSourceChanged: {
|
||||
if (sourceSize.width < width || sourceSize.height < height) {
|
||||
sourceSize = Qt.binding(function() {
|
||||
return Qt.size(width * 2, height * 2)
|
||||
})
|
||||
}
|
||||
else {
|
||||
sourceSize = undefined
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
|
|
Loading…
Reference in New Issue