mirror of
https://github.com/Shiewk/Widgets.git
synced 2026-04-28 11:34:17 +02:00
Fix widget settings editing on complex setups
(When there is an invisible setting overlapping another visible one, the invisible setting is no longer affected by user input)
This commit is contained in:
@@ -82,6 +82,7 @@ public class WidgetSettingsEditWidget extends ScrollableWidget {
|
||||
public boolean mouseClicked(double mouseX, double mouseY, int button) {
|
||||
mouseY += getScrollY();
|
||||
for (WidgetSettingOption customSetting : widget.getSettings().getCustomSettings()) {
|
||||
if (!customSetting.shouldShow()) continue;
|
||||
if (mouseX >= customSetting.getX() && mouseX <= customSetting.getX() + customSetting.getWidth()
|
||||
&& mouseY >= customSetting.getY() && mouseY <= customSetting.getY() + customSetting.getHeight()){
|
||||
focus = customSetting;
|
||||
@@ -101,6 +102,7 @@ public class WidgetSettingsEditWidget extends ScrollableWidget {
|
||||
@Override
|
||||
public boolean mouseReleased(double mouseX, double mouseY, int button) {
|
||||
for (WidgetSettingOption customSetting : widget.getSettings().getCustomSettings()) {
|
||||
if (!customSetting.shouldShow()) continue;
|
||||
if (customSetting.mouseReleased(mouseX, mouseY + getScrollY(), button)){
|
||||
onChange.run();
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user