Skip to content

Commit 64d91e8

Browse files
author
Lauren McCarthy
committed
fixing example for mouseclicked closes #1966
1 parent 70ded6c commit 64d91e8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/core/p5.Element.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,12 @@ p5.Element.prototype.mouseReleased = function (fxn) {
318318
* clicked over the element.
319319
* @return {p5.Element}
320320
* @example
321+
* <div>
322+
* <code class="norender">
321323
* var cnv;
322324
* var d;
323325
* var g;
326+
*
324327
* function setup() {
325328
* cnv = createCanvas(100, 100);
326329
* cnv.mouseClicked(changeGray); // attach listener for
@@ -345,8 +348,8 @@ p5.Element.prototype.mouseReleased = function (fxn) {
345348
* function changeGray() {
346349
* g = random(0, 255);
347350
* }
348-
* </code></div>
349-
*
351+
* </code>
352+
* </div>
350353
*
351354
* @alt
352355
* no display.

src/events/mouse.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@ p5.prototype._ondragover = p5.prototype._onmousemove;
671671
* fill(value);
672672
* rect(25, 25, 50, 50);
673673
* }
674+
*
674675
* function mouseClicked() {
675676
* if (value == 0) {
676677
* value = 255;

0 commit comments

Comments
 (0)