Skip to content
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

Merged
merged 27 commits into from
Oct 9, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
27b3e92
fix: 1054 perpendicular bidirectional tool on non-square pixel images
brunoalvesdefaria Sep 10, 2019
a8582ec
Reducing code complexity from bidirectional tool
brunoalvesdefaria Sep 10, 2019
b4a068b
Reducing code complexity from bidirectional tool
brunoalvesdefaria Sep 10, 2019
7b98df0
Reducing code complexity from moveLongLine method
brunoalvesdefaria Sep 10, 2019
4a23352
Removing amount of arguments from updateLine function
brunoalvesdefaria Sep 10, 2019
74785c3
Reducing code complexity from movePerpendicularLine method
brunoalvesdefaria Sep 10, 2019
352ca12
Improving code based on PR suggestions
brunoalvesdefaria Sep 10, 2019
cce764b
Reducing complexity of getBaseData method
brunoalvesdefaria Sep 10, 2019
06f6d25
Reducing complexity of updateLine function from moveLongLine method
brunoalvesdefaria Sep 10, 2019
733997c
Reducing complexity of movePerpendicularLine method
brunoalvesdefaria Sep 10, 2019
9a59bd7
Adding jsDoc and some unit tests for movePerpendicularLine method
brunoalvesdefaria Sep 11, 2019
d4a5141
Adding JSDoc and unit tests for moveLongLine method
brunoalvesdefaria Sep 17, 2019
046fe9e
Adding JSDoc and unit tests for movePerpendicularLine method
brunoalvesdefaria Sep 17, 2019
2863a62
Adding unit tests for updatePerpendicularLineHandles method
brunoalvesdefaria Sep 17, 2019
8588d48
Adding comments to the returned attributes from getBaseData
brunoalvesdefaria Sep 17, 2019
662be85
Reverting imageLoader changes to skew the image
brunoalvesdefaria Sep 17, 2019
7d12009
Removing test script added for bidirectional tool
brunoalvesdefaria Sep 17, 2019
c3d547b
Improving tests based on PR suggestions
brunoalvesdefaria Sep 17, 2019
9e6e3f6
Removing mocked function and mocking values instead
brunoalvesdefaria Sep 17, 2019
90a9c25
Removing unneeded proxy function
brunoalvesdefaria Sep 17, 2019
a388b26
Changing unit test description
brunoalvesdefaria Sep 17, 2019
c34c485
Using toBeCloseTo assertion to prevent precision issues
brunoalvesdefaria Sep 17, 2019
320a9b8
Using toMatchObject assertion when comparing object values
brunoalvesdefaria Sep 17, 2019
04c6e12
Started updating the handles from measurementData
brunoalvesdefaria Sep 17, 2019
bb27ad8
Renaming k variable to distanceRatio to make it more meaninful
brunoalvesdefaria Sep 17, 2019
d8ae8fd
Merge branch 'master' into issue-1054
swederik Oct 3, 2019
55a5388
Merge branch 'master' into issue-1054
dannyrb Oct 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@ export default function moveLongLine(
fixedPoint
) {
const baseData = getBaseData(measurementData, eventData, fixedPoint);
const {
columnPixelSpacing,
rowPixelSpacing,
distanceToFixed,
perpendicularStart,
perpendicularEnd,
} = baseData;
const { columnPixelSpacing, rowPixelSpacing, distanceToFixed } = baseData;

// Calculate the length of the new line, considering the proposed point
const newLineLength = getDistanceWithPixelSpacing(
Expand All @@ -51,10 +45,10 @@ export default function moveLongLine(
const newLine = updatePerpendicularLine(baseData, newIntersection);

// Update the perpendicular line handles
perpendicularStart.x = newLine.start.x;
perpendicularStart.y = newLine.start.y;
perpendicularEnd.x = newLine.end.x;
perpendicularEnd.y = newLine.end.y;
measurementData.handles.perpendicularStart.x = newLine.start.x;
measurementData.handles.perpendicularStart.y = newLine.start.y;
measurementData.handles.perpendicularEnd.x = newLine.end.x;
measurementData.handles.perpendicularEnd.y = newLine.end.y;

return true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ export default function movePerpendicularLine(
columnPixelSpacing,
rowPixelSpacing,
start,
perpendicularStart,
perpendicularEnd,
longLine,
intersection,
} = baseData;
Expand Down Expand Up @@ -66,10 +64,10 @@ export default function movePerpendicularLine(
);

// Change the position of the perpendicular line handles
perpendicularStart.x = newLine.start.x;
perpendicularStart.y = newLine.start.y;
perpendicularEnd.x = newLine.end.x;
perpendicularEnd.y = newLine.end.y;
measurementData.handles.perpendicularStart.x = newLine.start.x;
measurementData.handles.perpendicularStart.y = newLine.start.y;
measurementData.handles.perpendicularEnd.x = newLine.end.x;
measurementData.handles.perpendicularEnd.y = newLine.end.y;
dannyrb marked this conversation as resolved.
Show resolved Hide resolved

return true;
}