You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clear trail for full string width when scrolling text vertically
The `endText` function has the capability to scroll the printed text. In order to ensure artifacts are not left behind
on the display while scrolling, the library must clear the pixels at the previous location of the text after each frame
of the scrolling animation.
Previously, the code to handle this clearing for vertical scrolling only cleared a single character's width. This meant
that scroll trail clearing was only done for the first character in the string.
This bug might not be immediately apparent to the user because many character bitmaps do not populate any pixels on the
top or bottom row of the grid, and thus those characters provide incidental self scroll trail clearing. However, this is
not the case for all characters and those would cause a trail of artifacts to be left behind on the display when
scrolled.
The vertical scroll trail clearing code is hereby corrected to cover the full width of the string.
Previously the `ArduinoGraphics::bitmap` function was used by the clearing code. That approach was reasonable for
clearing the scroll trail of a single character, but due to the function's eight pixel width limitation, it is not
suitable to use with strings. In this application where a line of arbitrary length, but only one pixel thick is needed,
the `ArduinoGraphics::line` function is the suitable tool. So the code is ported to using `ArduinoGraphics::line`.
NOTE: The calculations of the length of the clearing line will still be incorrect for multi-line strings. However, this
is not a regression because it was also incorrect before this change. The scroll trail clearing code has never had any
provisions for handling multi-line strings so adding such support is out of scope for this commit. In addition, the text
scrolling code (not the scroll trail clearing code) has never correctly handled horizontal scrolling of multi-line
strings, so until that is fixed it is only the lack of correct scroll trail clearing for vertical scrolling that is
impactful to users.
0 commit comments