fixed regfression in showleds

see 65594842fc
This commit is contained in:
Peli de Halleux 2016-08-02 11:04:49 -07:00
parent e329b3bd2e
commit f365726a8e

View File

@ -197,7 +197,7 @@ namespace pxsim.basic {
clearScreen();
pause(interval * 5);
} else {
if (s.length == 1) showLeds(createImageFromString(s), interval * 5)
if (s.length == 1) showLeds(createImageFromString(s + " "), interval * 5)
else ImageMethods.scrollImage(createImageFromString(s + " "), 1, interval);
}
}
@ -726,7 +726,7 @@ namespace pxsim.ImageMethods {
interval: interval,
frame: () => {
//TODO: support right to left.
if (off >= leds.width + 5 || off < 0) return false;
if (off >= leds.width || off < 0) return false;
stride > 0 ? display.shiftLeft(stride) : display.shiftRight(-stride);
let c = Math.min(stride, leds.width - off);
leds.copyTo(off, c, display, 5 - stride)