diff --git a/ui/src/components/rects/SVGRectText.vue b/ui/src/components/rects/SVGRectText.vue index ad13d70..4eb7490 100644 --- a/ui/src/components/rects/SVGRectText.vue +++ b/ui/src/components/rects/SVGRectText.vue @@ -33,7 +33,18 @@ export default class extends Vue { } const parent = this.$el.parentElement; - return parent.clientWidth / parent.clientHeight; + const result = parent.clientWidth / parent.clientHeight; + + // force recompute for suspicious results + if (result === 0 || result === Infinity) { + // don't loop endlessly + if (this.refreshKey < 10000) { + this.refreshKey++; + } + return 1; + } + + return result; } public mounted() {