Skip to content

[2.0]: Properties of objects aren't being checked correctly by FES #7752

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

Open
1 of 17 tasks
davepagurek opened this issue Apr 17, 2025 · 0 comments
Open
1 of 17 tasks

Comments

@davepagurek
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
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

2.0.0

Web browser and version

Firefox

Operating system

MacOS

Steps to reproduce this

Steps:

If you run npm run docs and then check docs/parameterData.json, if you search for textToModel, it currently has these parameters:

"textToModel": {
      "overloads": [
        [
          "String",
          "Number",
          "Number",
          "Number",
          "Number",
          "Object?",
          "Number?",
          "Number?"
        ]
      ]
    }

This is because we're documenting the properties of the object like this:

* @param {String} str The text string to convert into a 3D model.
* @param {Number} x The x-coordinate for the starting position of the text.
* @param {Number} y The y-coordinate for the starting position of the text.
* @param {Number} width Maximum width of the text block (wraps text if exceeded).
* @param {Number} height Maximum height of the text block.
* @param {Object} [options] Configuration options for the 3D text:
* @param {Number} [options.extrude=0] The depth to extrude the text. A value of 0 produces
* flat text; higher values create thicker, 3D models.
* @param {Number} [options.sampleFactor=1] A factor controlling the level of detail for the text contours.
*  Higher values result in smoother curves.

It looks like we're mistakenly parsing options.extrude and options.sampleFactor as separate parameters, and not properties of options.

This likely needs a change in utils/convert.js.

@ksen0 ksen0 moved this to Ready for Work in p5.js 2.x 🌱🌳 Apr 17, 2025
@ksen0 ksen0 moved this from Ready for Work to Open for Discussion in p5.js 2.x 🌱🌳 Apr 17, 2025
@ksen0 ksen0 added this to the 2.1 milestone Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Open for Discussion
Development

No branches or pull requests

2 participants