Skip to content

Commit 4a8b81d

Browse files
committed
fixed example
1 parent 79d66c1 commit 4a8b81d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/events/pointer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ function pointer(p5, fn){
713713
* <div>
714714
* <code>
715715
* function setup() {
716-
* createCanvas(400, 400);
716+
* createCanvas(200, 200);
717717
*
718718
* describe(
719719
* 'A gray square with black text at its center. The text changes from 0 to either "left" or "right" when the user clicks a mouse button.'
@@ -728,7 +728,9 @@ function pointer(p5, fn){
728728
* textSize(16);
729729
*
730730
* // Display the mouse button.
731-
* text(JSON.stringify(mouseButton), 50, 50);
731+
* text(`Left: ${mouseButton.left}`, width / 2, height / 2 - 20);
732+
* text(`Right: ${mouseButton.right}`, width / 2, height / 2);
733+
* text(`Center: ${mouseButton.center}`, width / 2, height / 2 + 20);
732734
* }
733735
* </code>
734736
* </div>

0 commit comments

Comments
 (0)