ComposedElement initially sorts its elements and respects their elements' y position if both are Dropdowns
This commit is contained in:
@@ -14,6 +14,7 @@ public class ComposedElement implements GuiElement {
|
|||||||
|
|
||||||
public ComposedElement(GuiElement...parts) {
|
public ComposedElement(GuiElement...parts) {
|
||||||
this.parts = new ArrayList<GuiElement>(Arrays.asList(parts));
|
this.parts = new ArrayList<GuiElement>(Arrays.asList(parts));
|
||||||
|
Collections.sort(this.parts, COMPOSED_ELEMENT_COMPARATOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addPart(GuiElement part) {
|
public void addPart(GuiElement part) {
|
||||||
@@ -98,6 +99,10 @@ public class ComposedElement implements GuiElement {
|
|||||||
Boolean d1 = o1 instanceof GuiDropdown;
|
Boolean d1 = o1 instanceof GuiDropdown;
|
||||||
Boolean d2 = o2 instanceof GuiDropdown;
|
Boolean d2 = o2 instanceof GuiDropdown;
|
||||||
|
|
||||||
|
if(d1 && d2) {
|
||||||
|
return -new Integer(((GuiDropdown)o1).yPosition).compareTo(((GuiDropdown)o2).yPosition);
|
||||||
|
}
|
||||||
|
|
||||||
return d1.compareTo(d2);
|
return d1.compareTo(d2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user