Skip to content
Open
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
11 changes: 11 additions & 0 deletions core/src/processing/core/PApplet.java
Original file line number Diff line number Diff line change
Expand Up @@ -2681,6 +2681,17 @@ protected void handleMouseEvent(MouseEvent event) {
mouseX = event.getX();
mouseY = event.getY();
}
else if (action == MouseEvent.EXIT) {
// https://github.com/processing/processing/issues/4057
// Fix for OSX where mouseY can't reach 0 when using the
// default renderer, cause the action is MouseEvent.EXIT
// This also gives a better mouse position on exit, see:
// https://github.com/processing/processing/issues/4057#issuecomment-464332982
pmouseX = emouseX;
pmouseY = emouseY;
mouseX = constrain(event.getX(), 0, width-1);
mouseY = constrain(event.getY(), 0, height-1);
}

int button = event.getButton();

Expand Down