fix(G2DDrawControl): update label foreground color handling in setCustomData

This commit is contained in:
extio-de
2026-05-03 11:40:08 +02:00
parent 71382f699d
commit 1b7587b324
2 changed files with 5 additions and 2 deletions

View File

@@ -331,7 +331,10 @@ public class G2DDrawControl extends G2DAbstractRenderingBo implements ControlRen
(int) (this.visibleAreaHeight * scaleFactor));
if (this.clazz == LabelControl.class && this.labelData != null) {
((LabelControl) control).setCustomData(this.labelData);
final var labelForegroundColor = this.labelData != null && this.labelData.foregroundColor() != null
? this.labelData.foregroundColor()
: this.color;
((LabelControl) control).setCustomData(new LabelData(this.labelData.backgroundColor(), labelForegroundColor, this.labelData.textAlignment()));
}
else if (this.clazz == ToggleButtonControl.class && this.toggleButtonData != null) {
((ToggleButtonControl) control).setLastControlDataUpdateTime(this.lastControlDataUpdateTime);