Skip to content

Commit

Permalink
Graphics: wrapString now also wraps on slashes (to allow wrapping of …
Browse files Browse the repository at this point in the history
…URLs)
  • Loading branch information
gfwilliams committed Nov 20, 2023
1 parent 948f880 commit 7e05740
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
Storage: Storage.writeJSON now escapes with a more compact `\x##`/`\#` character escape notation (still valid JSON)
This allows Espruino to save non-unicode strings with characters in the unicode range, and to also re-load them as non-unicode
Graphics: Graphics.stringMetrics now returns 'unrenderableChars/imageCount/maxImageHeight' for much more info about rendering strings
Graphics: wrapString now also wraps on slashes (to allow wrapping of URLs)

2v19 : Fix Object.values/entries for numeric keys after 2v18 regression (fix #2375)
nRF52: for SD>5 use static buffers for advertising and scan response data (#2367)
Expand Down
2 changes: 1 addition & 1 deletion libs/graphics/jswrap_graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -2473,7 +2473,7 @@ JsVar *jswrap_graphics_wrapString(JsVar *parent, JsVar *str, int maxWidth) {
}
#endif
wordWidth += _jswrap_graphics_getCharWidth(&gfx, &info, ch);
if (ch==',' || ch=='.' || ch=='-' || ch=='-' || ch==':')
if (ch==',' || ch=='.' || ch=='-' || ch=='/' || ch=='\\' || ch==':')
canSplitAfter = true;
if (!jsvStringIteratorHasChar(&it)) endOfText=true;
}
Expand Down

0 comments on commit 7e05740

Please sign in to comment.