Skip to content

Commit

Permalink
Fix slider component always being selected
Browse files Browse the repository at this point in the history
  • Loading branch information
nea89o committed Sep 19, 2023
1 parent 84555f6 commit 97937e9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ open class SliderComponent(

override fun mouseEvent(mouseEvent: MouseEvent, context: GuiImmediateContext) {
if (!context.renderContext.isMouseButtonDown(0)) clicked = false
if (mouseEvent is MouseEvent.Click && mouseEvent.mouseState && mouseEvent.mouseButton == 0) {
if (context.isHovered && mouseEvent is MouseEvent.Click && mouseEvent.mouseState && mouseEvent.mouseButton == 0) {
clicked = true
}
if (clicked) {
Expand Down

0 comments on commit 97937e9

Please sign in to comment.