From 74fe2e3419e722023586dc8b6799f9f09e3394e6 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 30 Oct 2023 20:27:18 -0400 Subject: [PATCH] fix(ags overview): put a limit on icon sizes --- devices/wim/config/ags/js/overview/clients.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/devices/wim/config/ags/js/overview/clients.js b/devices/wim/config/ags/js/overview/clients.js index b0a97cc..56cb931 100644 --- a/devices/wim/config/ags/js/overview/clients.js +++ b/devices/wim/config/ags/js/overview/clients.js @@ -6,13 +6,20 @@ import { WindowButton } from './dragndrop.js'; import * as VARS from './variables.js'; const scale = size => size * VARS.SCALE - VARS.MARGIN; -const getFontSize = client => Math.min(scale(client.size[0]), - scale(client.size[1])) * VARS.ICON_SCALE; +const getFontSize = client => { + const valX = scale(client.size[0]) * VARS.ICON_SCALE; + const valY = scale(client.size[1]) * VARS.ICON_SCALE; -const IconStyle = client => `transition: font-size 0.2s linear; - min-width: ${scale(client.size[0])}px; - min-height: ${scale(client.size[1])}px; - font-size: ${getFontSize(client)}px;`; + var size = Math.min(valX, valY); + return size <= 0 ? 0.1 : size; +}; + +const IconStyle = client => ` + transition: font-size 0.2s linear; + min-width: ${scale(client.size[0])}px; + min-height: ${scale(client.size[1])}px; + font-size: ${getFontSize(client)}px; +`; const Client = (client, active, clients) => {