Skip to content

Commit de0dbf1

Browse files
committed
merging upstream changes
2 parents 0ef6abd + f5e1ab5 commit de0dbf1

File tree

6 files changed

+27
-9
lines changed

6 files changed

+27
-9
lines changed

docs/yuidoc-p5-theme/layouts/main.handlebars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
<li><a href="../learn/">Learn</a></li>
7070
<li><a href="../contribute/">Contribute</a></li>
7171
<li><a href="http://github.com/lmccart/p5.js" target=_blank class="other-link">Github</a></li>
72+
<li><a href="http://twitter.com/p5xjs" target=_blank class="other-link">Twitter</a></li>
7273
</ul>
7374
<br />
7475
</div>

lib/p5.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,11 @@ var core = function (require, shim, constants) {
240240
e.elt.removeEventListener(elt_ev, e._events[elt_ev]);
241241
}
242242
}
243+
var self = this;
243244
this._registeredMethods.remove.forEach(function (f) {
244-
f.call(this);
245+
if (typeof f !== 'undefined') {
246+
f.call(self);
247+
}
245248
});
246249
if (this._isGlobal) {
247250
for (var p in p5.prototype) {
@@ -262,7 +265,6 @@ var core = function (require, shim, constants) {
262265
}
263266
}
264267
}
265-
window.p5 = undefined;
266268
}.bind(this);
267269
for (var k in constants) {
268270
p5.prototype[k] = constants[k];

lib/p5.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/core.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,11 @@ define(function (require) {
329329
}
330330

331331
// call any registered remove functions
332-
this._registeredMethods.remove.forEach(function(f) {
333-
f.call(this);
332+
var self = this;
333+
this._registeredMethods.remove.forEach(function (f) {
334+
if (typeof(f) !== 'undefined') {
335+
f.call(self);
336+
}
334337
});
335338

336339
// remove window bound properties and methods
@@ -353,7 +356,7 @@ define(function (require) {
353356
}
354357
}
355358
}
356-
window.p5 = undefined;
359+
// window.p5 = undefined;
357360
}.bind(this);
358361

359362

src/input/keyboard.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ define(function (require) {
1111
var p5 = require('core');
1212

1313
/**
14-
* The boolean system variable isKeyPressed is true if any key is pressed
14+
* The boolean system variable keyIsPressed is true if any key is pressed
1515
* and false if no keys are pressed.
1616
*
17-
* @property isKeyPressed
17+
* @property keyIsPressed
1818
* @example
1919
* <div>
2020
* <code>
2121
* var value = 0;
2222
* function draw() {
23-
* if (isKeyPressed === true) {
23+
* if (keyIsPressed === true) {
2424
* fill(0);
2525
* } else {
2626
* fill(255);

src/objects/p5.Vector.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ define(function (require) {
3333
* @param {Number} [x] x component of the vector
3434
* @param {Number} [y] y component of the vector
3535
* @param {Number} [z] z component of the vector
36+
* @example
37+
* <div>
38+
* <code>
39+
* var vector = createVector(40, 50);
40+
* var vector2 = createVector(40, 50);
41+
*
42+
* ellipse(vector.x, vector.y, 50, 50);
43+
* ellipse(vector2.x, vector2.y, 50, 50);
44+
* vector.add(vector2);
45+
* ellipse(vector.x, vector.y, 50, 50);
46+
*</div>
47+
*</code>
3648
*/
3749
p5.Vector = function() {
3850
var x,y,z;

0 commit comments

Comments
 (0)