Skip to content

Commit

Permalink
chore: fix code review
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcc committed Jun 9, 2022
1 parent 63b3c8e commit b9b2e5f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/shape/interval/funnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ function getFunnelPoints(
const [p0, p1, p2, p3] = points;

if (isTranspose(coordinate)) {
const newP1 = [nextPoints ? nextPoints[0][0] : p1[0], p1[1]] as Vector2;
const newP2 = [nextPoints ? nextPoints[3][0] : p2[0], p2[1]] as Vector2;
const newP1: Vector2 = [nextPoints ? nextPoints[0][0] : p1[0], p1[1]];
const newP2: Vector2 = [nextPoints ? nextPoints[3][0] : p2[0], p2[1]];
return [p0, newP1, newP2, p3];
}
const newP1 = [p1[0], nextPoints ? nextPoints[0][1] : p1[1]] as Vector2;
const newP2 = [p2[0], nextPoints ? nextPoints[3][1] : p2[1]] as Vector2;
const newP1: Vector2 = [p1[0], nextPoints ? nextPoints[0][1] : p1[1]];
const newP2: Vector2 = [p2[0], nextPoints ? nextPoints[3][1] : p2[1]];
return [p0, newP1, newP2, p3];
}

Expand Down
16 changes: 8 additions & 8 deletions src/shape/interval/pyramid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ function getPyramidPoints(
const [p0, p1, p2, p3] = points;

if (isTranspose(coordinate)) {
const newP1 = [
const newP1: Vector2 = [
nextPoints ? nextPoints[0][0] : (p1[0] + p2[0]) / 2,
p1[1],
] as Vector2;
const newP2 = [
];
const newP2: Vector2 = [
nextPoints ? nextPoints[3][0] : (p1[0] + p2[0]) / 2,
p2[1],
] as Vector2;
];
return [p0, newP1, newP2, p3];
}
const newP1 = [
const newP1: Vector2 = [
p1[0],
nextPoints ? nextPoints[0][1] : (p1[1] + p2[1]) / 2,
] as Vector2;
const newP2 = [
];
const newP2: Vector2 = [
p2[0],
nextPoints ? nextPoints[3][1] : (p1[1] + p2[1]) / 2,
] as Vector2;
];
return [p0, newP1, newP2, p3];
}

Expand Down

0 comments on commit b9b2e5f

Please sign in to comment.