mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Bump prettier from 1.19.1 to 2.0.1 (#1060)
* Bump prettier from 1.19.1 to 2.0.1 Bumps [prettier](https://github.com/prettier/prettier) from 1.19.1 to 2.0.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/1.19.1...2.0.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Update formatting Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Panayiotis Lipiridis <lipiridis@gmail.com>
This commit is contained in:
parent
251fa27c65
commit
722c498abe
46 changed files with 170 additions and 170 deletions
|
@ -1,8 +1,8 @@
|
|||
import { Point } from "./types";
|
||||
|
||||
export function getSizeFromPoints(points: readonly Point[]) {
|
||||
const xs = points.map(point => point[0]);
|
||||
const ys = points.map(point => point[1]);
|
||||
const xs = points.map((point) => point[0]);
|
||||
const ys = points.map((point) => point[1]);
|
||||
return {
|
||||
width: Math.max(...xs) - Math.min(...xs),
|
||||
height: Math.max(...ys) - Math.min(...ys),
|
||||
|
@ -13,7 +13,7 @@ export function rescalePoints(
|
|||
nextDimensionSize: number,
|
||||
prevPoints: readonly Point[],
|
||||
): Point[] {
|
||||
const prevDimValues = prevPoints.map(point => point[dimension]);
|
||||
const prevDimValues = prevPoints.map((point) => point[dimension]);
|
||||
const prevMaxDimension = Math.max(...prevDimValues);
|
||||
const prevMinDimension = Math.min(...prevDimValues);
|
||||
const prevDimensionSize = prevMaxDimension - prevMinDimension;
|
||||
|
@ -22,7 +22,7 @@ export function rescalePoints(
|
|||
|
||||
let nextMinDimension = Infinity;
|
||||
|
||||
const scaledPoints = prevPoints.map(prevPoint =>
|
||||
const scaledPoints = prevPoints.map((prevPoint) =>
|
||||
prevPoint.map((value, currentDimension) => {
|
||||
if (currentDimension !== dimension) {
|
||||
return value;
|
||||
|
@ -36,7 +36,7 @@ export function rescalePoints(
|
|||
const translation = prevMinDimension - nextMinDimension;
|
||||
|
||||
const nextPoints = scaledPoints.map(
|
||||
scaledPoint =>
|
||||
(scaledPoint) =>
|
||||
scaledPoint.map((value, currentDimension) => {
|
||||
return currentDimension === dimension ? value + translation : value;
|
||||
}) as [number, number],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue