We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6646761 commit 259b827Copy full SHA for 259b827
files/usr/share/cinnamon/desklets/[email protected]/desklet.js
@@ -153,17 +153,9 @@ class CinnamonPhotoFrameDesklet extends Desklet.Desklet {
153
image.disconnect(image._notif_id);
154
155
let height, width;
156
- let imageRatio = image.width / image.height;
157
- let frameRatio = this.width / this.height;
158
-
159
- if (imageRatio > frameRatio) {
160
- width = this.width;
161
- height = this.width / imageRatio;
162
- } else {
163
- height = this.height;
164
- width = this.height * imageRatio;
165
- }
166
+ let ratio = Math.min(this.width / image.width, this.height / image.height);
+ width = ratio * image.width;
+ height = ratio * image.height;
167
image.set_size(width, height);
168
}
169
0 commit comments