Skip to content

Commit

Permalink
prettier -w .
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrudd2 committed Nov 3, 2023
1 parent d8a4533 commit e0f13ab
Show file tree
Hide file tree
Showing 18 changed files with 53 additions and 119 deletions.
17 changes: 6 additions & 11 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"plugins": [
"stylelint-order"
],
"rules": {
"order/order": [
"custom-properties",
"declarations"
],
"order/properties-alphabetical-order": true
}
}
"plugins": ["stylelint-order"],
"rules": {
"order/order": ["custom-properties", "declarations"],
"order/properties-alphabetical-order": true
}
}
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
2 changes: 1 addition & 1 deletion src/backgroundWindow/background.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
6 changes: 2 additions & 4 deletions src/components/Drawing/DrawingContent/DrawingContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,8 @@ export class DrawingContent extends React.Component {
};

getDrawingEndProcessor = () => {
const {
formatTempCoords,
formatFinalCoords
} = this.getActiveModeHandlers();
const { formatTempCoords, formatFinalCoords } =
this.getActiveModeHandlers();

if (formatFinalCoords != null) {
return formatFinalCoords;
Expand Down
5 changes: 2 additions & 3 deletions src/components/Drawing/DrawingSidebar/DrawingSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ class DrawingSidebar extends React.Component {
>
{mainMode === 'draw' &&
_.keys(DRAWING_MODES).map((modeKey) => {
const { displayName, emoji } = DRAWING_MODES[
modeKey
];
const { displayName, emoji } =
DRAWING_MODES[modeKey];
return (
<EmojiButton
key={modeKey}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ import PercentClicker from 'components/common/PercentClicker/PercentClicker';
import styles from './ShrinkCanvasOptions.styles.css';

const MultiplyCanvasOptions = (props) => {
const {
multiplyCanvasOptions,
globalHeight,
globalWidth,
dispatch
} = props;
const { multiplyCanvasOptions, globalHeight, globalWidth, dispatch } =
props;

const { x, y } = multiplyCanvasOptions;
const finalHeight = globalHeight * y;
Expand Down
5 changes: 2 additions & 3 deletions src/components/Drawing/modes/circle.mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ const makeCircle = (centerX, centerY, radius, pointsOnCircle = 50) => {
};

const formatTempCoords = (tempCoords, { pointsOnCircle }) => {
const [startCoords, endCoords] = getFirstAndLastCoordsFromTempCoords(
tempCoords
);
const [startCoords, endCoords] =
getFirstAndLastCoordsFromTempCoords(tempCoords);

const [x1, y1] = startCoords;
const [x2, y2] = endCoords;
Expand Down
10 changes: 4 additions & 6 deletions src/components/Drawing/modes/square.mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import { allPointsBetweenTwoCoords } from '../../../utils/coordUtils';
import { getFirstAndLastCoordsFromTempCoords } from '../../../utils/drawingUtils';

const formatTempCoords = (coords) => {
const [startCoords, endCoords] = getFirstAndLastCoordsFromTempCoords(
coords
);
const [startCoords, endCoords] =
getFirstAndLastCoordsFromTempCoords(coords);
const [startX, startY] = startCoords;
const [endX, endY] = endCoords;
const fourCorners = _.clone([
Expand All @@ -21,9 +20,8 @@ const formatTempCoords = (coords) => {

const formatFinalCoords = (coords, options) => {
const { pointsOnEachLine } = options;
const [startCoords, endCoords] = getFirstAndLastCoordsFromTempCoords(
coords
);
const [startCoords, endCoords] =
getFirstAndLastCoordsFromTempCoords(coords);
const [startX, startY] = startCoords;
const [endX, endY] = endCoords;

Expand Down
5 changes: 2 additions & 3 deletions src/components/Drawing/modes/straightLine.mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { allPointsBetweenTwoCoords } from '../../../utils/coordUtils';
import { getFirstAndLastCoordsFromTempCoords } from '../../../utils/drawingUtils';

const formatTempCoords = (tempCoords, { pointsOnEachLine }) => {
const [startCoords, endCoords] = getFirstAndLastCoordsFromTempCoords(
tempCoords
);
const [startCoords, endCoords] =
getFirstAndLastCoordsFromTempCoords(tempCoords);

const allPoints = allPointsBetweenTwoCoords(startCoords, endCoords, {
maxPointCount: pointsOnEachLine
Expand Down
16 changes: 4 additions & 12 deletions src/components/EfxSidebar/EfxSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,8 @@ class EfxSidebar extends React.Component {
};

processEfxLinesForLayer = (layerID) => {
const {
allOriginalLines,
globalSettings,
allLayers,
dispatch
} = this.props;
const { allOriginalLines, globalSettings, allLayers, dispatch } =
this.props;

const { filters } = allLayers.find((l) => l.id === layerID);
const linesForThisLayer = allOriginalLines[layerID];
Expand Down Expand Up @@ -281,12 +277,8 @@ class EfxSidebar extends React.Component {
dispatch
} = this.props;

const {
savingPreset,
savePresetName,
presets,
loadingMessage
} = this.state;
const { savingPreset, savePresetName, presets, loadingMessage } =
this.state;

return (
<SidebarContainer>
Expand Down
9 changes: 2 additions & 7 deletions src/components/GifmakerContent/GifmakerSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,8 @@ class GifmakerSidebar extends React.Component {
};

render() {
const {
loading,
frames,
gifFrameDelay,
gifBackgroundColor,
dispatch
} = this.props;
const { loading, frames, gifFrameDelay, gifBackgroundColor, dispatch } =
this.props;

if (loading) {
return <SidebarContainer> LOADING </SidebarContainer>;
Expand Down
18 changes: 4 additions & 14 deletions src/components/OptionsSidebar/OptionsSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,8 @@ class OptionsSidebar extends React.Component {
};

isDirty = () => {
const {
height,
width,
pointShowRadius,
pointShowColor,
shiftToDraw
} = this.props;
const { height, width, pointShowRadius, pointShowColor, shiftToDraw } =
this.props;
const {
tempHeight,
tempWidth,
Expand All @@ -92,13 +87,8 @@ class OptionsSidebar extends React.Component {
};

render() {
const {
height,
width,
pointShowRadius,
pointShowColor,
shiftToDraw
} = this.props;
const { height, width, pointShowRadius, pointShowColor, shiftToDraw } =
this.props;
const {
tempHeight,
tempWidth,
Expand Down
7 changes: 2 additions & 5 deletions src/components/PlotSidebar/PlotSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,8 @@ class PlotSidebar extends React.Component {
dispatch(setCurrentPlotPercentage(0));

const lineDrawCallback = (response) => {
const {
currentLineId,
currentLineCount,
totalLineCount
} = response;
const { currentLineId, currentLineCount, totalLineCount } =
response;

dispatch(setCurrentLineId(currentLineId));
this.setCurrentLineIndex(currentLineCount);
Expand Down
16 changes: 4 additions & 12 deletions src/filters/Distort.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ const filterName = 'distort';
const displayName = 'dist0rt';

const DistortComponent = ({ filterSettings, updateOptions }) => {
const {
percentToAffect,
distortionAmount,
horizontal,
vertical
} = filterSettings;
const { percentToAffect, distortionAmount, horizontal, vertical } =
filterSettings;

return (
<>
Expand Down Expand Up @@ -66,12 +62,8 @@ const DistortComponent = ({ filterSettings, updateOptions }) => {
export const DistortFilter = ({ filterSettings, pointArrays }) => {
if (!filterSettings || !filterSettings.enabled) return pointArrays;

const {
percentToAffect,
distortionAmount,
horizontal,
vertical
} = filterSettings;
const { percentToAffect, distortionAmount, horizontal, vertical } =
filterSettings;

const yValueMap = {};
const xValueMap = {};
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
18 changes: 10 additions & 8 deletions src/utils/__tests__/coordUtils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,22 @@ describe('isPointOnLineBetweenTwoCoords()', () => {
it('should return true when point is on line', () => {
const startCoords = [0, 0];
const endCoords = [100, 100];
const result = isPointOnLineBetweenTwoCoords(startCoords, endCoords, [
10,
10
]);
const result = isPointOnLineBetweenTwoCoords(
startCoords,
endCoords,
[10, 10]
);
expect(result).toBe(true);
});

it('should return false when point is not on line', () => {
const startCoords = [0, 0];
const endCoords = [100, 100];
const result = isPointOnLineBetweenTwoCoords(startCoords, endCoords, [
10,
50
]);
const result = isPointOnLineBetweenTwoCoords(
startCoords,
endCoords,
[10, 50]
);
expect(result).toBe(false);
});
});
21 changes: 2 additions & 19 deletions src/utils/__tests__/fillLines.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,25 +142,8 @@ const testLinesAtAngle = (context, angle) => {
};

const ANGLES = [
0,
10,
20,
30,
40,
50,
60,
70,
80,
90,
100,
110,
120,
130,
140,
150,
160,
170,
180
0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160,
170, 180
];

describe('Draw Lines At Angle', () => {
Expand Down
5 changes: 2 additions & 3 deletions src/utils/lineSortUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ export const findNearestLine = (currentLine, remainingLines) => {
).end;

remainingLines.forEach(({ id, pointArrayContainer }) => {
const { start, end } = getStartAndEndPointsOfCoords(
pointArrayContainer
);
const { start, end } =
getStartAndEndPointsOfCoords(pointArrayContainer);

const startDistance = distanceBetweenTwoCoords(currentLineEnd, start);
const endDistance = distanceBetweenTwoCoords(currentLineEnd, end);
Expand Down

0 comments on commit e0f13ab

Please sign in to comment.