mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Copy paste bug : add unit tests for FrameUtils with null value
This commit is contained in:
@ -1,6 +1,28 @@
|
||||
(function () {
|
||||
var ns = $.namespace('test.testutils');
|
||||
|
||||
/**
|
||||
* Frame.createFromGrid accepts grids that are rotated by 90deg from
|
||||
* the visual/usual way. (column-based grid)
|
||||
*
|
||||
* For testing, it's easier for be able to specify a row-based grid, because
|
||||
* it visually matches what the image will look like.
|
||||
*
|
||||
* For instance :
|
||||
*
|
||||
* [[black, black, black],
|
||||
* [white, white, white]]
|
||||
*
|
||||
* we expect this to be a 3x2 image, one black line above a white line.
|
||||
*
|
||||
* However Frame.createFromGrid needs the following input to create such an image :
|
||||
*
|
||||
* [[black, white],
|
||||
* [black, white],
|
||||
* [black, white]]
|
||||
*
|
||||
* This helper will build the second array from the first array.
|
||||
*/
|
||||
ns.toFrameGrid = function (normalGrid) {
|
||||
var frameGrid = [];
|
||||
var w = normalGrid[0].length;
|
||||
|
Reference in New Issue
Block a user