Skip to content

Commit

Permalink
style: fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Oct 4, 2019
1 parent 7f7422c commit 70918dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/js/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ export default {

// All the numerical parameters should be integer for `drawImage`
// https://github.com/fengyuanchen/cropper/issues/476
context.drawImage(source, ...params.map(param => Math.floor(normalizeDecimalNumber(param))));
context.drawImage(source, ...params.map((param) => Math.floor(normalizeDecimalNumber(param))));

return canvas;
},
Expand Down
11 changes: 6 additions & 5 deletions src/js/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function isNumber(value) {
* @param {*} value - The value to check.
* @returns {boolean} Returns `true` if the given value is a positive number, else `false`.
*/
export const isPositiveNumber = value => value > 0 && value < Infinity;
export const isPositiveNumber = (value) => value > 0 && value < Infinity;

/**
* Check if the given value is undefined.
Expand Down Expand Up @@ -536,7 +536,7 @@ export function getTransforms({
* @returns {number} The result ratio.
*/
export function getMaxZoomRatio(pointers) {
const pointers2 = assign({}, pointers);
const pointers2 = { ...pointers };
const ratios = [];

forEach(pointers, (pointer, pointerId) => {
Expand Down Expand Up @@ -572,10 +572,11 @@ export function getPointer({ pageX, pageY }, endOnly) {
endY: pageY,
};

return endOnly ? end : assign({
return endOnly ? end : ({
startX: pageX,
startY: pageY,
}, end);
...end,
});
}

/**
Expand Down Expand Up @@ -755,7 +756,7 @@ export function getSourceCanvas(
context.scale(scaleX, scaleY);
context.imageSmoothingEnabled = imageSmoothingEnabled;
context.imageSmoothingQuality = imageSmoothingQuality;
context.drawImage(image, ...params.map(param => Math.floor(normalizeDecimalNumber(param))));
context.drawImage(image, ...params.map((param) => Math.floor(normalizeDecimalNumber(param))));
context.restore();
return canvas;
}
Expand Down

0 comments on commit 70918dc

Please sign in to comment.