mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
add integration tests for PNG export & scaled export
This commit is contained in:
@@ -145,7 +145,11 @@
|
||||
ns.PngExportController.prototype.onDownloadClick_ = function (evt) {
|
||||
// Create PNG export.
|
||||
var canvas = this.createPngSpritesheet_();
|
||||
this.downloadCanvas_(canvas);
|
||||
};
|
||||
|
||||
// Used and overridden in casper integration tests.
|
||||
ns.PngExportController.prototype.downloadCanvas_ = function (canvas) {
|
||||
// Generate file name
|
||||
var name = this.piskelController.getPiskel().getDescriptor().name;
|
||||
var fileName = name + '.png';
|
||||
|
||||
@@ -269,6 +269,19 @@
|
||||
}
|
||||
|
||||
return chunkFrames;
|
||||
},
|
||||
|
||||
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;
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user