-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 1054 perpendicular bidirectional tool on non-square pixel images #1063
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1063 +/- ##
=========================================
+ Coverage 17.83% 19% +1.17%
=========================================
Files 274 282 +8
Lines 8428 8391 -37
Branches 1420 1419 -1
=========================================
+ Hits 1503 1595 +92
+ Misses 5759 5643 -116
+ Partials 1166 1153 -13
Continue to review full report at Codecov.
|
src/tools/annotation/bidirectionalTool/utils/updatePerpendicularLineHandles.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/utils/updatePerpendicularLineHandles.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/getDistance.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/moveLongLine.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/getBaseData.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/getLineVector.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/moveLongLine.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/moveLongLine.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/movePerpendicularLine.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/movePerpendicularLine.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/movePerpendicularLine.js
Outdated
Show resolved
Hide resolved
@brunoalvesdefaria, please feel free to ping me if you have questions/pushback. |
src/tools/annotation/bidirectionalTool/moveHandle/getBaseData.test.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/getBaseData.test.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/getBaseData.test.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/getBaseData.test.js
Outdated
Show resolved
Hide resolved
...tools/annotation/bidirectionalTool/moveHandle/moveLongLine/getDistanceToIntersection.test.js
Outdated
Show resolved
Hide resolved
...tools/annotation/bidirectionalTool/moveHandle/moveLongLine/getDistanceToIntersection.test.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/moveLongLine/getDistanceToIntersection.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/moveLongLine/moveLongLine.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/moveLongLine/moveLongLine.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/moveLongLine/moveLongLine.js
Outdated
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/moveHandle/moveLongLine/updatePerpendicularLine.js
Show resolved
Hide resolved
...tools/annotation/bidirectionalTool/moveHandle/movePerpendicularLine/movePerpendicularLine.js
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/utils/updatePerpendicularLineHandles.js
Show resolved
Hide resolved
src/tools/annotation/bidirectionalTool/utils/updatePerpendicularLineHandles.js
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
test('')
andit('')
should read as plain english - centralize updated by reference to the tool itself
- If you have alternative thoughts/suggestions, we can discuss
- Prefer object equality assertions over many individual property assertions
- Use
toBeCloseTo
for float equality checks - A function/method should only take the parameters it requires in order to function. Passing
baseData
in it's entirety can make it confusing/difficult to know what data is actually required for the function to work -- it also makes re-use much more difficult -
updateSomeData
functions should begetUpdatedSomeData
, where you return thenew
and set it in the tool where you can isolate changes to the reference.
🎉 This PR is included in version 4.5.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR fixes the issue #1054 where the bidirectional tool was not being created with its lines perpendicular for images with non-square pixels.
The angle between its lines were always assuming an angle different from 90º.
The issue was happening both when the users were creating a bidirectional tool measurement or editing an existing one.
With this fix, most part of the complexity and duplicated code was removed from the logic responsible to calculate the handles position when creating or editing bidirectional tool measurements.