@@ -76,17 +76,17 @@ AbstractButton {
7676 visible: cardData && cardData["art"] || false
7777
7878 readonly property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1
79− readonly property bool useImageWidthForWidth: image.fillMode === Image.PreserveAspectCrop || aspect < image.aspect
79+ readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect
8080
8181 Component.onCompleted: updateWidthHeightBindings();
82− onUseImageWidthForWidthChanged: updateWidthHeightBindings();
82+ onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings();
8383
8484 function updateWidthHeightBindings() {
85− if (useImageWidthForWidth) {
86− width = Qt.binding(function() { return visible ? image.width : 0 });
87− height = Qt.binding(function() { return visible ? width / image.aspect : 0 });
85+ if (aspectSmallerThanImageAspect) {
86+ width = Qt.binding(function() { return !visible ? 0 : image.width });
87+ height = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.height : width / image.aspect });
8888 } else {
89− width = Qt.binding(function() { return visible ? height * image.aspect : 0 });
89+ width = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.width : height * image.aspect });
9090 height = Qt.binding(function() { return visible ? image.height : 0 });
9191 }
9292 }