Applied autofix for object-curly-newline rule.

This commit is contained in:
Filip Barl
2017-10-17 17:39:02 +02:00
parent d9a8afe81d
commit 2fcbdb7e16
45 changed files with 209 additions and 78 deletions

View File

@@ -4,7 +4,9 @@ const applyTranslateY = ({ scaleY = 1, translateY = 0 }, y) => (y * scaleY) + tr
const applyScaleX = ({ scaleX = 1 }, width) => width * scaleX;
const applyScaleY = ({ scaleY = 1 }, height) => height * scaleY;
export const applyTransform = (transform, { width = 0, height = 0, x, y }) => ({
export const applyTransform = (transform, {
width = 0, height = 0, x, y
}) => ({
x: applyTranslateX(transform, x),
y: applyTranslateY(transform, y),
width: applyScaleX(transform, width),
@@ -17,7 +19,9 @@ const inverseTranslateY = ({ scaleY = 1, translateY = 0 }, y) => (y - translateY
const inverseScaleX = ({ scaleX = 1 }, width) => width / scaleX;
const inverseScaleY = ({ scaleY = 1 }, height) => height / scaleY;
export const inverseTransform = (transform, { width = 0, height = 0, x, y }) => ({
export const inverseTransform = (transform, {
width = 0, height = 0, x, y
}) => ({
x: inverseTranslateX(transform, x),
y: inverseTranslateY(transform, y),
width: inverseScaleX(transform, width),
@@ -25,6 +29,8 @@ export const inverseTransform = (transform, { width = 0, height = 0, x, y }) =>
});
export const transformToString = ({ translateX = 0, translateY = 0, scaleX = 1, scaleY = 1 }) => (
export const transformToString = ({
translateX = 0, translateY = 0, scaleX = 1, scaleY = 1
}) => (
`translate(${translateX},${translateY}) scale(${scaleX},${scaleY})`
);