Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shubham Goyal
- ,
- 8 mins
- ,
- New
- @mudit sharma
- export const getCoordinatesFromName = (board, pointName) => {
- return board.elementsByName[pointName].getAttributes().originalcoords;
- }
- is a utils function, can also be used in other components, correct?
- Shubham Goyal
- ,
- 7 mins
- ,
- Edited,
- New
- const length1 = calcDistanceBetweenTwoPoints(
- pointA,
- pointB
- );
- name it lengthAB, what is length1? 😛
- mudit sharma
- ,
- 6 mins
- ,
- New
- yes
- Shubham Goyal
- ,
- 6 mins
- ,
- Edited,
- New
- if(angle.value == "90" && ang.degree != 90) {
- const perpendicularSlopeLineBC = calculatePerpendicularSlope(pointB, pointC);
- const dummyCoordinates = pointOnLineFromPointAtDistance(pointB, perpendicularSlopeLineBC, length1);
- const dummyCoordinate = calcDistanceBetweenTwoPoints(pointA,dummyCoordinates[0]) > calcDistanceBetweenTwoPoints(pointA,dummyCoordinates[1])
- ? dummyCoordinates[1]
- : dummyCoordinates[0];
- const dummyPointObject = getDummyPointObject(dummyCoordinate);
- const dummyPoint = createDummyPoint(dummyPointObject, board);
- angle.between[0] = dummyPointObject.name;
- }
- should be separated into another other function
- mudit sharma
- ,
- 5 mins
- ,
- New
- sure
- Shubham Goyal
- ,
- 4 mins
- ,
- New
- const dummyCoordinate = calcDistanceBetweenTwoPoints(pointA,dummyCoordinates[0]) > calcDistanceBetweenTwoPoints(pointA,dummyCoordinates[1])
- ? dummyCoordinates[1]
- : dummyCoordinates[0];
- I do not get the logic
- explain 😛
- I know you are trying to see which point is nearer
- ah I get it now
- mudit sharma
- ,
- 3 mins
- ,
- New
- 🙂
- Shubham Goyal
- ,
- 2 mins
- ,
- New
- and you refactored code, that is amazing
- your tests are trying to test what?
- Shubham Goyal
- ,
- 1 min
- ,
- Edited,
- New
- There is no test for -
- 1. Is the drawn angle actually 90 degrees?
- 2. Is the drawn point visible?
- 3. Have you drawn the angle in the right direction?
- @mudit sharma your tests should test the main contribution of the pull request, in this case, it is these 3 - you can probably add more
- reply if you disagree 😛 I can be wrong
- mudit sharma
- ,
- Now
- ,
- New
- agreed
- 2nd point is tested
- not 1 and 3 though
- Shubham Goyal
- ,
- Now
- ,
- New
- yes
- sorry yeah
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement