Fix linting errors

This commit is contained in:
Julian Descottes 2021-07-02 15:08:05 +02:00
parent 117d094df9
commit 881d2f1100
5 changed files with 27 additions and 27 deletions

View File

@ -74,9 +74,9 @@
{
importType: this.getImportType_(),
frameSizeX: this.getImportType_() === 'single' ?
this.resizeWidth.value : this.sanitizeInputValue_(this.frameSizeX, 1),
this.resizeWidth.value : this.sanitizeInputValue_(this.frameSizeX, 1),
frameSizeY: this.getImportType_() === 'single' ?
this.resizeHeight.value : this.sanitizeInputValue_(this.frameSizeY, 1),
this.resizeHeight.value : this.sanitizeInputValue_(this.frameSizeY, 1),
frameOffsetX: this.sanitizeInputValue_(this.frameOffsetX, 0),
frameOffsetY: this.sanitizeInputValue_(this.frameOffsetY, 0),
smoothing: !!this.smoothResize.checked,

View File

@ -83,21 +83,21 @@
batchAll(frames, function (frame) {
return this.cachedFrameProcessor.get(frame);
}.bind(this))
.then(function (results) {
var colors = {};
results.forEach(function (result) {
Object.keys(result).forEach(function (color) {
colors[color] = true;
.then(function (results) {
var colors = {};
results.forEach(function (result) {
Object.keys(result).forEach(function (color) {
colors[color] = true;
});
});
});
// Remove transparent color from used colors
delete colors[pskl.utils.colorToInt(Constants.TRANSPARENT_COLOR)];
// Remove transparent color from used colors
delete colors[pskl.utils.colorToInt(Constants.TRANSPARENT_COLOR)];
var hexColors = Object.keys(colors).map(function (color) {
return pskl.utils.intToHex(color);
});
this.setCurrentColors(hexColors);
}.bind(this));
var hexColors = Object.keys(colors).map(function (color) {
return pskl.utils.intToHex(color);
});
this.setCurrentColors(hexColors);
}.bind(this));
};
ns.CurrentColorsService.prototype.isCurrentColorsPaletteSelected_ = function () {

View File

@ -97,15 +97,15 @@
* @private
*/
ns.ImportService.prototype.createImagesFromSheet_ = function (image,
frameSizeX, frameSizeY, frameOffsetX, frameOffsetY) {
frameSizeX, frameSizeY, frameOffsetX, frameOffsetY) {
return pskl.utils.CanvasUtils.createFramesFromImage(
image,
frameOffsetX,
frameOffsetY,
frameSizeX,
frameSizeY,
/*useHorizonalStrips=*/ true,
/*ignoreEmptyFrames=*/ true);
image,
frameOffsetX,
frameOffsetY,
frameSizeX,
frameSizeY,
/*useHorizonalStrips=*/ true,
/*ignoreEmptyFrames=*/ true);
};
/**
@ -116,7 +116,7 @@
* @private
*/
ns.ImportService.prototype.createPiskelFromImages_ = function (images, name,
frameSizeX, frameSizeY, smoothing) {
frameSizeX, frameSizeY, smoothing) {
name = name || 'Imported piskel';
var frames = this.createFramesFromImages_(images, frameSizeX, frameSizeY, smoothing);
var layer = pskl.model.Layer.fromFrames('Layer 1', frames);

View File

@ -259,7 +259,7 @@
for (var j = 0 ; j < row.length ; j++) {
context.clearRect(0, 0 , frameWidth, frameHeight);
context.drawImage(image, frameWidth * i, frameHeight * j,
frameWidth, frameHeight, 0, 0, frameWidth, frameHeight);
frameWidth, frameHeight, 0, 0, frameWidth, frameHeight);
var frame = pskl.utils.FrameUtils.createFromCanvas(canvas, 0, 0, frameWidth, frameHeight);
chunkFrames.push({
index : layout[i][j],

View File

@ -3,8 +3,8 @@
var s4 = function () {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
.toString(16)
.substring(1);
};
ns.Uuid = {