mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
Fix potential out of bounds Graphics.scroll
This commit is contained in:
parent
4fbd56e487
commit
3d63b355ea
@ -1,6 +1,7 @@
|
||||
Fix issues with Class Extends
|
||||
Improve Tab Completions for extended classes
|
||||
Fix Storage.readJSON/readArrayBuffer memory leak (fix #1532)
|
||||
Fix potential out of bounds Graphics.scroll
|
||||
|
||||
2v00 : Allow changeInterval with large (>32 bit) intervals (fix #1438)
|
||||
changeInterval now changes the interval immediately when it's called inside the interval it is changing (fix #1440)
|
||||
|
||||
@ -73,7 +73,7 @@ void graphicsFallbackScroll(JsGraphics *gfx, int xdir, int ydir) {
|
||||
if (xdir==0 && ydir==0) return;
|
||||
int y;
|
||||
if (ydir<=0) {
|
||||
int h = gfx->data.height+xdir;
|
||||
int h = gfx->data.height+ydir;
|
||||
for (y=0;y<h;y++)
|
||||
graphicsFallbackScrollX(gfx, xdir, y-ydir, y);
|
||||
} else { // >0
|
||||
|
||||
10
test_graphics_scroll.js
Normal file
10
test_graphics_scroll.js
Normal file
@ -0,0 +1,10 @@
|
||||
g = Graphics.createArrayBuffer(128,64,1);
|
||||
g.drawString("Hello");
|
||||
var before = g.buffer.toString();
|
||||
g.scroll(0,5);
|
||||
g.scroll(0,-5);
|
||||
g.scroll(5,0);
|
||||
g.scroll(-5,0);
|
||||
|
||||
var after = g.buffer.toString();
|
||||
result = before == after;
|
||||
Loading…
x
Reference in New Issue
Block a user