From 8adce12e09e21213d027d7bb7efb0f787e37d19e Mon Sep 17 00:00:00 2001 From: HendrikThePendric Date: Thu, 10 Oct 2024 17:26:10 +0200 Subject: [PATCH] fix: force reload the getBBox call to prevent getting stale dimensions --- .../singleValue/renderer/checkIfFitsWithinContainer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/renderer/checkIfFitsWithinContainer.js b/src/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/renderer/checkIfFitsWithinContainer.js index 355728aef..182611977 100644 --- a/src/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/renderer/checkIfFitsWithinContainer.js +++ b/src/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/renderer/checkIfFitsWithinContainer.js @@ -8,9 +8,9 @@ export function checkIfFitsWithinContainer( subText, spacing ) { - const valueRect = valueElement.getBBox() + const valueRect = valueElement.getBBox(true) const subTextRect = subText - ? subTextElement.getBBox() + ? subTextElement.getBBox(true) : { width: 0, height: 0 } const requiredValueWidth = icon ? valueRect.width + spacing.iconGap + spacing.iconSize