Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@ public void cycleValue(int increment) {
}

@Override
public boolean mouseClicked(MouseButtonEvent event, boolean doubleClick) {
if (!isMouseOver(event.x(), event.y()) || (event.button() != 0 && event.button() != 1) || !isAvailable())
public boolean mouseClicked(@NonNull MouseButtonEvent event, boolean doubleClick) {
if (!isMouseOver(event.x(), event.y()) || (event.button() != InputConstants.MOUSE_BUTTON_LEFT && event.button() != InputConstants.MOUSE_BUTTON_RIGHT) || !isAvailable())
return false;

playDownSound();
cycleValue(event.button() == 1 || event.hasShiftDown() || event.hasControlDown() ? -1 : 1);

cycleValue(event.button() == InputConstants.MOUSE_BUTTON_RIGHT || event.hasShiftDown() || event.hasControlDown() ? -1 : 1);
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected void extractValueText(GuiGraphicsExtractor graphics, int mouseX, int m

@Override
public boolean mouseClicked(@NonNull MouseButtonEvent event, boolean doubleClick) {
if (!isAvailable() || event.button() != 0 || !isHoveredSliderBounds(event.x(), event.y()))
if (!isAvailable() || event.button() != InputConstants.MOUSE_BUTTON_LEFT || !isHoveredSliderBounds(event.x(), event.y()))
return false;

mouseDown = true;
Expand All @@ -78,7 +78,7 @@ private boolean isHoveredSliderBounds(double mouseX, double mouseY) {

@Override
public boolean mouseDragged(@NonNull MouseButtonEvent event, double dx, double dy) {
if (!isAvailable() || event.button() != 0 || !mouseDown)
if (!isAvailable() || event.button() != InputConstants.MOUSE_BUTTON_LEFT || !mouseDown)
return false;

setValueFromMouse(event.x());
Expand Down
Loading