Skip to content

text() swallows characters in CHAR wrap mode #7437

Closed
@top-mind

Description

@top-mind

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.

Activity

welcome

welcome commented on Dec 20, 2024

@welcome

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!

top-mind

top-mind commented on Dec 21, 2024

@top-mind
Author

Assumption: no one use textWrap(CHAR) after release 1.4.0 ?

dhowe

dhowe commented on Jan 10, 2025

@dhowe
Contributor

fixed for 2.x in #7356

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @dhowe@davepagurek@top-mind

      Issue actions

        text() swallows characters in CHAR wrap mode · Issue #7437 · processing/p5.js