File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/main/java/de/dennisguse/opentracks/chart Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -683,10 +683,18 @@ private record TitleDimensions(
683
683
*/
684
684
private void drawSeriesTitles (Canvas canvas ) {
685
685
Iterator <TitlePosition > tpI = titleDimensions .titlePositions .iterator ();
686
+
686
687
for (ChartValueSeries chartValueSeries : seriesList ) {
687
688
if (chartValueSeries .isEnabled () && chartValueSeries .hasData () || allowIfEmpty (chartValueSeries )) {
688
689
String title = getContext ().getString (chartValueSeries .getTitleId (unitSystem ));
689
690
Paint paint = chartValueSeries .getTitlePaint ();
691
+
692
+ // It is possible for the titlePositions to become empty temporarily, while switching between
693
+ // chart screens quickly.
694
+ if (!tpI .hasNext ()) {
695
+ return ;
696
+ }
697
+
690
698
TitlePosition tp = tpI .next ();
691
699
int y = topBorder - spacer - (titleDimensions .lineCount - tp .line ) * (titleDimensions .lineHeight + spacer );
692
700
canvas .drawText (title , tp .xPos + getScrollX (), y , paint );
You can’t perform that action at this time.
0 commit comments