Skip to content

Commit 99a7f99

Browse files
hxrshxzCopilot
andauthored
Update src/core/environment.js
Co-authored-by: Copilot <[email protected]>
1 parent b5edac0 commit 99a7f99

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/environment.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,11 @@ p5.prototype._onresize = function(e) {
790790
) {
791791
this._updateNextMouseCoords(evt);
792792
}
793-
// Otherwise, do not update mouse coordinates, as the last event's coordinates may be stale
793+
// Otherwise, do not update mouse coordinates. In this case, the mouse coordinates
794+
// retain their previous values, which may not reflect the current mouse position.
795+
// This can occur if the window is resized without a recent mouse event (e.g., if the
796+
// user resizes the window without moving the mouse). The coordinates remain unchanged
797+
// until the next valid mouse event is received.
794798
}
795799
const context = this._isGlobal ? window : this;
796800
let executeDefault;

0 commit comments

Comments
 (0)