Skip to content

Commit 3e02286

Browse files
author
lauren mccarthy
committed
correct to have updatepcoords calls at end of draw, closes issue #367
1 parent 48b3268 commit 3e02286

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

lib/p5.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ var core = function (require, shim, constants) {
199199
f.call(this);
200200
});
201201
userDraw();
202+
this._updatePMouseCoords();
203+
this._updatePTouchCoords();
202204
this._registeredMethods.post.forEach(function (f) {
203205
f.call(this);
204206
});
@@ -2954,7 +2956,6 @@ var inputmouse = function (require, core, constants) {
29542956
p5.prototype.mouseIsPressed = false;
29552957
p5.prototype.isMousePressed = false;
29562958
p5.prototype._updateMouseCoords = function (e) {
2957-
this._updatePMouseCoords();
29582959
if (e.type === 'touchstart' || e.type === 'touchmove') {
29592960
this._setProperty('mouseX', this.touchX);
29602961
this._setProperty('mouseY', this.touchY);
@@ -3110,7 +3111,6 @@ var inputtouch = function (require, core) {
31103111
p5.prototype.ptouchY = 0;
31113112
p5.prototype.touches = [];
31123113
p5.prototype._updateTouchCoords = function (e) {
3113-
this._updatePTouchCoords();
31143114
if (e.type === 'mousedown' || e.type === 'mousemove') {
31153115
this._setProperty('touchX', this.mouseX);
31163116
this._setProperty('touchY', this.mouseY);

lib/p5.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/core.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ define(function (require) {
280280
f.call(this);
281281
});
282282
userDraw();
283-
// this._updatePMouseCoords();
284-
// this._updatePTouchCoords();
283+
this._updatePMouseCoords();
284+
this._updatePTouchCoords();
285285
// call any registered post functions
286286
this._registeredMethods.post.forEach(function(f) {
287287
f.call(this);

src/input/mouse.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ define(function (require) {
101101
p5.prototype.isMousePressed = false; // both are supported
102102

103103
p5.prototype._updateMouseCoords = function(e) {
104-
this._updatePMouseCoords();
105104
if(e.type === 'touchstart' || e.type === 'touchmove') {
106105
this._setProperty('mouseX', this.touchX);
107106
this._setProperty('mouseY', this.touchY);

src/input/touch.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ define(function (require) {
6161
p5.prototype.touches = [];
6262

6363
p5.prototype._updateTouchCoords = function(e) {
64-
this._updatePTouchCoords();
6564
if(e.type === 'mousedown' || e.type === 'mousemove'){
6665
this._setProperty('touchX', this.mouseX);
6766
this._setProperty('touchY', this.mouseY);

0 commit comments

Comments
 (0)