Skip to content

wrapping error in graphics.printf #267

@ericabxy

Description

@ericabxy

There is apparently an off-by-one error in function "love.graphics.printf". In my test case I draw two boxes of 8x8 characters intended to wrap at 64px (eight characters wide). The box on the left is drawn with a "limit" parameter of 64, and the box on the right is drawn with a "limit" parameter of 63.

Image
Image

With LÖVE, the characters in the left box are allowed to exactly fill the 64px limit before wrapping, while of course in the right box the eighth character would exceed 63px and thus wraps instead.

With Lutro, the characters in the left box fill the 64px limit and one more character is allowed to be printed before wrapping. The box on the right is allowed to print the eighth character, exceeding the 63px limit. Both diverge from expected LÖVE API behavior.

Printf wrapping was apparently implemented to fix issue #77.

printfwrap.zip

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