From 02a55585445c32fdcb1dbc015d93d7c816eb75c8 Mon Sep 17 00:00:00 2001 From: Joe Pavitt Date: Sat, 12 Oct 2024 17:32:56 +0100 Subject: [PATCH] Gauge - Revert to using only width to calculate value font-size --- ui/src/widgets/ui-gauge/types/UIGaugeDial.vue | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ui/src/widgets/ui-gauge/types/UIGaugeDial.vue b/ui/src/widgets/ui-gauge/types/UIGaugeDial.vue index cef33fe3d..f3f4840e8 100644 --- a/ui/src/widgets/ui-gauge/types/UIGaugeDial.vue +++ b/ui/src/widgets/ui-gauge/types/UIGaugeDial.vue @@ -394,18 +394,14 @@ export default { }, resizeText () { const clientWidth = this.$refs.value?.clientWidth - const clientHeight = this.$refs.value?.clientHeight - - // work out how much space we have within which to render the value/icon/range - const minDimension = Math.min(clientWidth || 0, clientHeight || 0) this.size = 'default' - if (minDimension < 80) { + if (clientWidth < 80) { this.size = 'xxs' - } else if (minDimension < 150) { + } else if (clientWidth < 150) { this.size = 'xs' - } else if (minDimension < 225) { + } else if (clientWidth < 225) { this.size = 'sm' - } else if (minDimension < 300) { + } else if (clientWidth < 300) { this.size = 'md' } else { this.size = 'lg'