Fix #242, onion skin rendered not cleared if 0 frames

This commit is contained in:
juliandescottes
2014-12-27 15:02:41 +01:00
parent 043f077408
commit 5831447f75
8 changed files with 201 additions and 79 deletions

View File

@ -0,0 +1,22 @@
(function () {
var ns = $.namespace('test.testutils');
ns.toFrameGrid = function (normalGrid) {
var frameGrid = [];
var w = normalGrid[0].length;
var h = normalGrid.length;
for (var x = 0 ; x < w ; x++) {
frameGrid[x] = [];
for (var y = 0 ; y < h ; y++) {
frameGrid[x][y] = normalGrid[y][x];
}
}
return frameGrid;
};
ns.frameEqualsGrid = function (frame, grid) {
frame.forEachPixel(function (color, col, row) {
expect(color).toBe(grid[row][col]);
});
};
})();