Skip to content

Commit

Permalink
feat: function return type
Browse files Browse the repository at this point in the history
  • Loading branch information
RoxaneBurri committed Mar 13, 2023
1 parent 6918127 commit fcf2135
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ export const setFirstWordInCenterOfParent = (w: Word, p: string): Rectangle => {
};

// This function put the word in a random place
export const placeWordOnOuterCircle = (w: Rectangle) => {
export const placeWordOnOuterCircle = (w: Rectangle): Rectangle => {
// Chose the parent face
const angle = Math.random() * 360;
const radius = Math.max(CONTAINER_HEIGHT, CONTAINER_WIDTH) / 2;
console.log(angle);
const newPosition = {
...w,
x: radius * Math.cos(angle) + CENTER_X,
Expand Down Expand Up @@ -91,7 +90,7 @@ export const futurPosition = (
word: Rectangle,
passRect: Rectangle[],
step: number
) => {
): Rectangle => {
let isCollision = false;
let movedWord: Rectangle = {
x: word.x,
Expand Down

0 comments on commit fcf2135

Please sign in to comment.