Skip to content

Commit 8fee3a0

Browse files
committed
fix position indicator
1 parent 4ee2f82 commit 8fee3a0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/DisplayManager.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,15 @@ void drawConfigurableIndicators() {
106106
int indicatorY = 285; // Positioned in the middle area
107107
int indicatorWidth = 60; // Made slightly smaller to fit better
108108

109+
// Pack enabled indicators without gaps
110+
int currentPosition = 0;
109111
for (int i = 0; i < currentDisplayConfig.activeIndicatorCount; i++) {
110112
IndicatorConfig &indicator = currentDisplayConfig.indicators[i];
111113
if (indicator.enabled && indicator.position < 8) {
112114
bool state = getIndicatorValue(indicator.indicator);
113-
drawSmallButton(indicatorX + (indicatorWidth * indicator.position), indicatorY, indicator.label, state);
115+
// Use currentPosition instead of indicator.position to pack without gaps
116+
drawSmallButton(indicatorX + (indicatorWidth * currentPosition), indicatorY, indicator.label, state);
117+
currentPosition++; // Increment position for next enabled indicator
114118
}
115119
}
116120
}

0 commit comments

Comments
 (0)