Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphics.wrapString only cuts a word in half once #2194

Closed
gfwilliams opened this issue May 10, 2022 · 3 comments
Closed

Graphics.wrapString only cuts a word in half once #2194

gfwilliams opened this issue May 10, 2022 · 3 comments

Comments

@gfwilliams
Copy link
Member

Mentioned at: espruino/BangleApps#1380

g.clear().setFont("4x6");
lines = g.wrapString("ABCDEFGHIJ", 10);
// lines is ["AB","CDEFGHIJ"]
// lines should be ["AB","CD","EF","GH","IJ"]

Not trivial to fix in jswrap_graphics_wrapString with the current code though - it'll need refactoring a bit

@thyttan
Copy link
Contributor

thyttan commented Nov 21, 2022

Just leaving a comment here to mention I encountered this bug today while coding on a new Bangle.js 2 app.

Reading the discussion on espruino/BangleApps#1380 I'm thinking it could be worth mention this bug in the HW reference for Graphics.wrapString? I can do a PR for that if you think it's a good idea, @gfwilliams.

@gfwilliams
Copy link
Member Author

Yes, I guess a note in the hardware reference would be good.

... of course if someone wanted to actually fix this, that would be better ;)

@gfwilliams
Copy link
Member Author

Fixed with 19868ef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants