Skip to content

Commit

Permalink
fix vertical slider not working properly
Browse files Browse the repository at this point in the history
  • Loading branch information
brachy84 committed Jan 29, 2025
1 parent ff9b91a commit 977f644
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ public void onUpdate() {

@Override
public @NotNull Result onMousePressed(int mouseButton) {
int p = getContext().unTransformX(getContext().getAbsMouseX(), getContext().getAbsMouseY());
int p = this.axis.isHorizontal() ?
getContext().unTransformX(getContext().getAbsMouseX(), getContext().getAbsMouseY()) :
getContext().unTransformY(getContext().getAbsMouseX(), getContext().getAbsMouseY());
setValue(posToValue(p), true);
this.dragging = true;
return Result.SUCCESS;
Expand Down

0 comments on commit 977f644

Please sign in to comment.