Skip to content

Commit

Permalink
Merge pull request #1390 from FlowFuse/1385-gauge-value-size
Browse files Browse the repository at this point in the history
Gauge - Revert to using only width to calculate value font-size
  • Loading branch information
joepavitt authored Oct 12, 2024
2 parents e7b34be + 02a5558 commit 5281dd1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions ui/src/widgets/ui-gauge/types/UIGaugeDial.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 5281dd1

Please sign in to comment.