Skip to content

Commit 3189e64

Browse files
committed
make sure maxs are not larger than the mins
1 parent 7c02420 commit 3189e64

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

services/static-webserver/client/source/class/osparc/info/ServiceLarge.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,12 @@ qx.Class.define("osparc.info.ServiceLarge", {
391391
},
392392

393393
__createThumbnail: function(maxWidth, maxHeight = 160) {
394+
// make sure maxs are not larger than the mins
395+
const minWidth = Math.max(120, maxWidth);
396+
const minHeight = Math.max(139, maxHeight);
397+
maxWidth = Math.max(minWidth, maxWidth);
398+
maxHeight = Math.max(minHeight, maxHeight);
399+
394400
const serviceData = this.getService();
395401
const thumbnail = osparc.info.Utils.createThumbnail(maxWidth, maxHeight);
396402
if (serviceData["thumbnail"]) {
@@ -403,8 +409,8 @@ qx.Class.define("osparc.info.ServiceLarge", {
403409
source: noThumbnail
404410
});
405411
thumbnail.getChildControl("image").set({
406-
minWidth: Math.max(120, maxWidth),
407-
minHeight: Math.max(139, maxHeight)
412+
minWidth,
413+
minHeight,
408414
});
409415
}
410416
return thumbnail;

0 commit comments

Comments
 (0)