Skip to content

text() swallows characters in CHAR wrap mode #7437

Closed
@top-mind

Description

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

1.4.0-1.11.2

Web browser and version

MS Edge 131.0.2903.70 (Official build) (64-bit)

Operating system

Linux

Steps to reproduce this

Snippet:

function setup() {
  createCanvas(100, 100);
  textWrap(CHAR);
  text("1\n222\n3", 0, 0, 20);
  // which should be
  // 1
  // 22
  // 2
  // 3
  // but
  // 22
  // 3
}

Screenshot from 2024-12-21 07-48-42

Cause:

A copy-paste bug in text() function.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions