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

@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.extio</groupId>
<artifactId>game-engine</artifactId>
<version>1.0.11</version>
<version>1.0.12</version>
<properties>
<java.version>25</java.version>

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);