Skip to content

Calling getContentSize() after setString() in CCLabelTTF deforms label #3405

@ntrrgc

Description

@ntrrgc

Let have a CCLabelTTF called myLabel. Using the web inspector console, set a string in it:

myLabel.setString("2");

Everything should be fine, like in this image:

Now do the same, but using a string of different size and calling getContentSize() immediately after:

myLabel.setString("200"); myLabel.getContentSize()

The label gets deformed, like this:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions