Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p5.Element doubleClicked missing @chainable in doc. #6208

Closed
2 of 17 tasks
asukaminato0721 opened this issue Jun 14, 2023 · 1 comment · Fixed by #6209
Closed
2 of 17 tasks

p5.Element doubleClicked missing @chainable in doc. #6208

asukaminato0721 opened this issue Jun 14, 2023 · 1 comment · Fixed by #6209

Comments

@asukaminato0721
Copy link
Contributor

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build Process
  • Unit Testing
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

p5.js version

1.6.0

Web browser and version

1.52.122 Chromium: 114.0.5735.110

Operating System

Linux

Steps to reproduce this

/**
* The <a href="#/p5.Element/doubleClicked">doubleClicked()</a> method is called once after every time a
* mouse button is pressed twice over the element. This can be used to
* attach element and action-specific event listeners.
*
* @method doubleClicked
* @param {Function|Boolean} fxn function to be fired when mouse is
* double clicked over the element.
* if `false` is passed instead, the previously
* firing function will no longer fire.
* @return {p5.Element}
* @example
* <div class='norender'><code>
* let cnv, d, g;
* function setup() {
* cnv = createCanvas(100, 100);
* cnv.doubleClicked(changeGray); // attach listener for
* // canvas double click only
* d = 10;
* g = 100;
* }
*
* function draw() {
* background(g);
* ellipse(width / 2, height / 2, d, d);
* }
*
* // this function fires with any double click anywhere
* function doubleClicked() {
* d = d + 10;
* }
*
* // this function fires only when cnv is double clicked
* function changeGray() {
* g = random(0, 255);
* }
* </code></div>
*
* @alt
* no display.
*/
doubleClicked(fxn) {
p5.Element._adjustListener('dblclick', fxn, this);
return this;
}

@welcome
Copy link

welcome bot commented Jun 14, 2023

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant