if (!sectionsVisible) {
fontSize = size * 0.08;
thresholdText.setFont(Fonts.latoRegular(fontSize));
thresholdText.setTextOrigin(VPos.CENTER);
if (thresholdText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(thresholdText, maxWidth, fontSize); }
<BUG>thresholdText.setX((size - thresholdText.getLayoutBounds().getWidth()) * 0.5);
</BUG>
thresholdText.setY(thresholdRect.getLayoutBounds().getMinY() + thresholdRect.getHeight() * 0.5);
}
}

if (!sectionsVisible) {
fontSize = size * 0.08;
thresholdText.setFont(Fonts.latoRegular(fontSize));
thresholdText.setTextOrigin(VPos.CENTER);
if (thresholdText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(thresholdText, maxWidth, fontSize); }
thresholdText.setX((width - thresholdText.getLayoutBounds().getWidth()) * 0.5);
thresholdText.setY(thresholdRect.getLayoutBounds().getMinY() + thresholdRect.getHeight() * 0.5);
}
}
