processing/p5.js

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

オープン

#7,752 opened on 2025/04/17

 (19 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (3,178 件のフォーク)batch import
BugHelp Wantedp5.js 2.0+

Repository metrics

Stars
 (20,784 個のスター)
PR merge metrics
 (平均マージ 8d 13h) (30d で 45 merged PRs)

説明

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.

コントリビューターガイド