3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-09-07 00:22:51 +02:00

merge color with parent

Dieser Commit ist enthalten in:
Jesse Boyd 2019-11-21 21:04:39 +00:00
Ursprung 1a5e8c395a
Commit 2061035bc6
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 59F1DE6293AF6E1F

Datei anzeigen

@ -35,29 +35,33 @@ public class Caption {
}
}
}
TextColor lastColor = parent.color();
List<Component> children = parent.children();
if (!children.isEmpty()) {
TextColor lastColor = parent.color();
for (int i = 0; i < children.size(); i++) {
Component child = children.get(i);
Component coloredChild = color(child);
if (coloredChild.color() == null && lastColor != null) {
coloredChild = coloredChild.color(lastColor);
Component original = children.get(i);
Component child = original;
if (child.color() == null && lastColor != null) {
child = child.color(lastColor);
}
if (coloredChild != child) {
child = color(child);
if (original != child) {
if (!(children instanceof ArrayList)) {
children = new ArrayList<>(children);
}
children.set(i, coloredChild);
children.set(i, child);
}
if (coloredChild.color() != null) {
lastColor = coloredChild.color();
if (child.color() != null) {
lastColor = child.color();
}
}
if (children instanceof ArrayList) {
parent = parent.children(children);
}
}
if (parent.color() == null && lastColor != null) {
parent = parent.color(lastColor);
}
return parent;
}