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
For example uBit.display.print("Hi O갎o") displays the O character 4 times in a row (갎 is 0xEA 0xB0 0x8E in UTF-8, which I can confirm is what I see compiled in the code). It does not blink, it's just permanently shown for 4x the animation time.
This is because when a character is "printed" on the display, it uses the image buffer in the display instance to render the character using Image::print(), which exits early if the character is out-of-range and doesn't change the image: codal-core/source/types/Image.cpp#L578
So, when printing "Hi O갎o", it shows O for 4 iterations.
The change would be simple, in AnimatedDisplay::updatePrintText() we could check the return value from Image::print() and clear the display if the return is DEVICE_INVALID_PARAMETER: codal-core/source/drivers/AnimatedDisplay.cpp#L182
This would align a bit more with what uBit.display.scroll() currently does, but it would be considered a change in behaviour (V1 and V2 do the same now), so maybe we might not want to change this.
The text was updated successfully, but these errors were encountered:
For example
uBit.display.print("Hi O갎o")
displays theO
character 4 times in a row (갎
is0xEA 0xB0 0x8E
in UTF-8, which I can confirm is what I see compiled in the code). It does not blink, it's just permanently shown for 4x the animation time.This is because when a character is "printed" on the display, it uses the image buffer in the display instance to render the character using
Image::print()
, which exits early if the character is out-of-range and doesn't change the image:codal-core/source/types/Image.cpp#L578
So, when printing
"Hi O갎o"
, it showsO
for 4 iterations.The change would be simple, in
AnimatedDisplay::updatePrintText()
we could check the return value fromImage::print()
and clear the display if the return isDEVICE_INVALID_PARAMETER
:codal-core/source/drivers/AnimatedDisplay.cpp#L182
This would align a bit more with what
uBit.display.scroll()
currently does, but it would be considered a change in behaviour (V1 and V2 do the same now), so maybe we might not want to change this.The text was updated successfully, but these errors were encountered: