espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.76k stars 741 forks source link

Graphics.wrapString only wraps the first line #2304

Closed nxdefiant closed 1 year ago

nxdefiant commented 1 year ago

Seen on BangleJS 2, firmware 2v16.11:

g.setFont("6x8:4").wrapString("abcdefghijklmopqrstuvwxyz", Bangle.appRect.w)

=[ "abcdefg", "hijklmopqrstuvwxyz" ]

I would have expected all lines to be max. floor(176px/(6px*4))=7 characters. The second line is obviously longer.

gfwilliams commented 1 year ago

Duplicate of https://github.com/espruino/Espruino/issues/2194