Syntax changes to meet code style

This commit is contained in:
Matt D 2016-03-23 21:50:43 +11:00
parent da105e6237
commit a712764401
2 changed files with 7 additions and 7 deletions

View File

@ -58,12 +58,12 @@
}; };
ns.PngExportController.prototype.mergedExport_ = function (zip) { 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++) { for (var i = 0; i < this.piskelController.getFrameCount(); i++) {
var frame = this.piskelController.getFrameAt(i); var frame = this.piskelController.getFrameAt(i);
var canvas = this.getFrameAsCanvas_(frame); var canvas = this.getFrameAsCanvas_(frame);
var basename = this.pngFilePrefixInput.value; 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'; var filename = basename + id + '.png';
zip.file(filename, pskl.utils.CanvasUtils.getBase64FromCanvas(canvas) + '\n', {base64: true}); zip.file(filename, pskl.utils.CanvasUtils.getBase64FromCanvas(canvas) + '\n', {base64: true});
} }
@ -71,16 +71,16 @@
ns.PngExportController.prototype.splittedExport_ = function (zip) { ns.PngExportController.prototype.splittedExport_ = function (zip) {
var layers = this.piskelController.getLayers(); var layers = this.piskelController.getLayers();
var framePaddingLength = (""+this.piskelController.getFrameCount()).length; var framePaddingLength = ('' + this.piskelController.getFrameCount()).length;
var layerPaddingLength = (""+layers.length).length; var layerPaddingLength = ('' + layers.length).length;
for (var j = 0; this.piskelController.hasLayerAt(j); j++) { for (var j = 0; this.piskelController.hasLayerAt(j); j++) {
var layer = this.piskelController.getLayerAt(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++) { for (var i = 0; i < this.piskelController.getFrameCount(); i++) {
var frame = layer.getFrameAt(i); var frame = layer.getFrameAt(i);
var canvas = this.getFrameAsCanvas_(frame); var canvas = this.getFrameAsCanvas_(frame);
var basename = this.pngFilePrefixInput.value; 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'; var filename = 'l' + layerid + '_' + basename + frameid + '.png';
zip.file(filename, pskl.utils.CanvasUtils.getBase64FromCanvas(canvas) + '\n', {base64: true}); zip.file(filename, pskl.utils.CanvasUtils.getBase64FromCanvas(canvas) + '\n', {base64: true});
} }

View File

@ -6,5 +6,5 @@
var padding = new Array(length).join(pad); var padding = new Array(length).join(pad);
return (padding + input).slice(-length); return (padding + input).slice(-length);
}, },
} };
})(); })();