mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Fix linting errors
This commit is contained in:
parent
117d094df9
commit
881d2f1100
@ -74,9 +74,9 @@
|
|||||||
{
|
{
|
||||||
importType: this.getImportType_(),
|
importType: this.getImportType_(),
|
||||||
frameSizeX: this.getImportType_() === 'single' ?
|
frameSizeX: this.getImportType_() === 'single' ?
|
||||||
this.resizeWidth.value : this.sanitizeInputValue_(this.frameSizeX, 1),
|
this.resizeWidth.value : this.sanitizeInputValue_(this.frameSizeX, 1),
|
||||||
frameSizeY: this.getImportType_() === 'single' ?
|
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),
|
frameOffsetX: this.sanitizeInputValue_(this.frameOffsetX, 0),
|
||||||
frameOffsetY: this.sanitizeInputValue_(this.frameOffsetY, 0),
|
frameOffsetY: this.sanitizeInputValue_(this.frameOffsetY, 0),
|
||||||
smoothing: !!this.smoothResize.checked,
|
smoothing: !!this.smoothResize.checked,
|
||||||
|
@ -83,21 +83,21 @@
|
|||||||
batchAll(frames, function (frame) {
|
batchAll(frames, function (frame) {
|
||||||
return this.cachedFrameProcessor.get(frame);
|
return this.cachedFrameProcessor.get(frame);
|
||||||
}.bind(this))
|
}.bind(this))
|
||||||
.then(function (results) {
|
.then(function (results) {
|
||||||
var colors = {};
|
var colors = {};
|
||||||
results.forEach(function (result) {
|
results.forEach(function (result) {
|
||||||
Object.keys(result).forEach(function (color) {
|
Object.keys(result).forEach(function (color) {
|
||||||
colors[color] = true;
|
colors[color] = true;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
// Remove transparent color from used colors
|
||||||
// Remove transparent color from used colors
|
delete colors[pskl.utils.colorToInt(Constants.TRANSPARENT_COLOR)];
|
||||||
delete colors[pskl.utils.colorToInt(Constants.TRANSPARENT_COLOR)];
|
|
||||||
|
|
||||||
var hexColors = Object.keys(colors).map(function (color) {
|
var hexColors = Object.keys(colors).map(function (color) {
|
||||||
return pskl.utils.intToHex(color);
|
return pskl.utils.intToHex(color);
|
||||||
});
|
});
|
||||||
this.setCurrentColors(hexColors);
|
this.setCurrentColors(hexColors);
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
};
|
};
|
||||||
|
|
||||||
ns.CurrentColorsService.prototype.isCurrentColorsPaletteSelected_ = function () {
|
ns.CurrentColorsService.prototype.isCurrentColorsPaletteSelected_ = function () {
|
||||||
|
@ -97,15 +97,15 @@
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ns.ImportService.prototype.createImagesFromSheet_ = function (image,
|
ns.ImportService.prototype.createImagesFromSheet_ = function (image,
|
||||||
frameSizeX, frameSizeY, frameOffsetX, frameOffsetY) {
|
frameSizeX, frameSizeY, frameOffsetX, frameOffsetY) {
|
||||||
return pskl.utils.CanvasUtils.createFramesFromImage(
|
return pskl.utils.CanvasUtils.createFramesFromImage(
|
||||||
image,
|
image,
|
||||||
frameOffsetX,
|
frameOffsetX,
|
||||||
frameOffsetY,
|
frameOffsetY,
|
||||||
frameSizeX,
|
frameSizeX,
|
||||||
frameSizeY,
|
frameSizeY,
|
||||||
/*useHorizonalStrips=*/ true,
|
/*useHorizonalStrips=*/ true,
|
||||||
/*ignoreEmptyFrames=*/ true);
|
/*ignoreEmptyFrames=*/ true);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -116,7 +116,7 @@
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ns.ImportService.prototype.createPiskelFromImages_ = function (images, name,
|
ns.ImportService.prototype.createPiskelFromImages_ = function (images, name,
|
||||||
frameSizeX, frameSizeY, smoothing) {
|
frameSizeX, frameSizeY, smoothing) {
|
||||||
name = name || 'Imported piskel';
|
name = name || 'Imported piskel';
|
||||||
var frames = this.createFramesFromImages_(images, frameSizeX, frameSizeY, smoothing);
|
var frames = this.createFramesFromImages_(images, frameSizeX, frameSizeY, smoothing);
|
||||||
var layer = pskl.model.Layer.fromFrames('Layer 1', frames);
|
var layer = pskl.model.Layer.fromFrames('Layer 1', frames);
|
||||||
|
@ -259,7 +259,7 @@
|
|||||||
for (var j = 0 ; j < row.length ; j++) {
|
for (var j = 0 ; j < row.length ; j++) {
|
||||||
context.clearRect(0, 0 , frameWidth, frameHeight);
|
context.clearRect(0, 0 , frameWidth, frameHeight);
|
||||||
context.drawImage(image, frameWidth * i, frameHeight * j,
|
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);
|
var frame = pskl.utils.FrameUtils.createFromCanvas(canvas, 0, 0, frameWidth, frameHeight);
|
||||||
chunkFrames.push({
|
chunkFrames.push({
|
||||||
index : layout[i][j],
|
index : layout[i][j],
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
var s4 = function () {
|
var s4 = function () {
|
||||||
return Math.floor((1 + Math.random()) * 0x10000)
|
return Math.floor((1 + Math.random()) * 0x10000)
|
||||||
.toString(16)
|
.toString(16)
|
||||||
.substring(1);
|
.substring(1);
|
||||||
};
|
};
|
||||||
|
|
||||||
ns.Uuid = {
|
ns.Uuid = {
|
||||||
|
Loading…
Reference in New Issue
Block a user