Properly respect expanded state of GuiDropdown in its isHovering() method
This commit is contained in:
@@ -162,6 +162,20 @@ public class GuiDropdown<T extends GuiEntryListEntry> extends GuiAdvancedTextFie
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isHovering(int mouseX, int mouseY) {
|
||||||
|
if(isExpanded()) {
|
||||||
|
int requiredHeight = Math.min(elements.size() * dropoutElementHeight, maxDropoutHeight);
|
||||||
|
|
||||||
|
return mouseX >= xPosition
|
||||||
|
&& mouseY >= yPosition
|
||||||
|
&& mouseX < xPosition + width
|
||||||
|
&& mouseY < yPosition + height + requiredHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.isHovering(mouseX, mouseY);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setText(String text) {
|
public void setText(String text) {
|
||||||
if(!getText().equals(text)) {
|
if(!getText().equals(text)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user