processing / p5.js

p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —
http://p5js.org/
GNU Lesser General Public License v2.1
21.11k stars 3.22k forks source link

fixed parameters for normal() method #6984

Closed kaiserarg closed 2 months ago

kaiserarg commented 2 months ago

Resolves #6982

Changes:

It seems that in src\core\shape\vertex.js for the normal() method the documentation was written as @param {Vector} vectorand since Vectorisn't a native JS class when the FES couldn't use instanceOf to check and typeOfchecked the e.g. example let n = createVector(-0.4, -0.4, 0.8); which would return object since Vector is not a native JS class.

A quick and easy fix would be to change @param {Vector} vector to @param {p5.Vector} vector so FES can correctly check the parameter.

Screenshots of the change:

image

PR Checklist