mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Syntax changes to meet code style
This commit is contained in:
parent
da105e6237
commit
a712764401
@ -58,12 +58,12 @@
|
||||
};
|
||||
|
||||
ns.PngExportController.prototype.mergedExport_ = function (zip) {
|
||||
var paddingLength = (""+this.piskelController.getFrameCount()).length;
|
||||
var paddingLength = ('' + this.piskelController.getFrameCount()).length;
|
||||
for (var i = 0; i < this.piskelController.getFrameCount(); i++) {
|
||||
var frame = this.piskelController.getFrameAt(i);
|
||||
var canvas = this.getFrameAsCanvas_(frame);
|
||||
var basename = this.pngFilePrefixInput.value;
|
||||
var id = pskl.utils.StringUtils.leftPad(i, paddingLength, "0");
|
||||
var id = pskl.utils.StringUtils.leftPad(i, paddingLength, '0');
|
||||
var filename = basename + id + '.png';
|
||||
zip.file(filename, pskl.utils.CanvasUtils.getBase64FromCanvas(canvas) + '\n', {base64: true});
|
||||
}
|
||||
@ -71,16 +71,16 @@
|
||||
|
||||
ns.PngExportController.prototype.splittedExport_ = function (zip) {
|
||||
var layers = this.piskelController.getLayers();
|
||||
var framePaddingLength = (""+this.piskelController.getFrameCount()).length;
|
||||
var layerPaddingLength = (""+layers.length).length;
|
||||
var framePaddingLength = ('' + this.piskelController.getFrameCount()).length;
|
||||
var layerPaddingLength = ('' + layers.length).length;
|
||||
for (var j = 0; this.piskelController.hasLayerAt(j); j++) {
|
||||
var layer = this.piskelController.getLayerAt(j);
|
||||
var layerid = pskl.utils.StringUtils.leftPad(j, layerPaddingLength, "0");
|
||||
var layerid = pskl.utils.StringUtils.leftPad(j, layerPaddingLength, '0');
|
||||
for (var i = 0; i < this.piskelController.getFrameCount(); i++) {
|
||||
var frame = layer.getFrameAt(i);
|
||||
var canvas = this.getFrameAsCanvas_(frame);
|
||||
var basename = this.pngFilePrefixInput.value;
|
||||
var frameid = pskl.utils.StringUtils.leftPad(i + 1, framePaddingLength, "0");
|
||||
var frameid = pskl.utils.StringUtils.leftPad(i + 1, framePaddingLength, '0');
|
||||
var filename = 'l' + layerid + '_' + basename + frameid + '.png';
|
||||
zip.file(filename, pskl.utils.CanvasUtils.getBase64FromCanvas(canvas) + '\n', {base64: true});
|
||||
}
|
||||
|
@ -6,5 +6,5 @@
|
||||
var padding = new Array(length).join(pad);
|
||||
return (padding + input).slice(-length);
|
||||
},
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user