From 8521ea02c91054b53e0c825e4f5a2b4a8cea014a Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Wed, 8 Jul 2026 17:33:28 +0200 Subject: [PATCH] Avoid IndexOutOfBoundsException in Legend --- .../src/main/kotlin/info/appdev/charting/components/Legend.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chartLib/src/main/kotlin/info/appdev/charting/components/Legend.kt b/chartLib/src/main/kotlin/info/appdev/charting/components/Legend.kt index 81f9c174..96638065 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/components/Legend.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/components/Legend.kt @@ -446,7 +446,7 @@ class Legend() : ComponentBase() { if (label != null) { calculatedLabelSizes.add(labelPaint.calcTextSize(label)) requiredWidth += if (drawingForm) formToTextSpace + formSize else 0f - requiredWidth += calculatedLabelSizes[i].width + requiredWidth += calculatedLabelSizes.last().width } else { calculatedLabelSizes.add(FSize.getInstance(0f, 0f)) requiredWidth += if (drawingForm) formSize else 0f