LT-123: intersected attribute is removed in intersectLine method,

getIntersectionRect method returns topLeft and bottomRight points instead of left, right, top, bottom points
This commit is contained in:
Aysel Afsar committed 2016-01-14 13:16:41 -05:00
1 parent 12a326c7fe
commit f9d697dea0
3 files changed
+60 -61

No files matched your search

@@ -408,7 +408,7 @@
};
var intersection = cornerstoneMath.lineSegment.intersectLine(longLine, perpendicularLine);
if (!intersection.intersected) {
if (!intersection) {
if (cornerstoneMath.point.distance(movedPoint, data.handles.start) > cornerstoneMath.point.distance(movedPoint, data.handles.end)) {
data.handles.perpendicularStart.x = adjustedLineP2.x + distanceFromMoved * dy;
data.handles.perpendicularStart.y = adjustedLineP2.y - distanceFromMoved * dx;
@@ -490,7 +490,7 @@
};
var intersection = cornerstoneMath.lineSegment.intersectLine(longLine, perpendicularLine);
if (!intersection.intersected) {
if (!intersection) {
if (cornerstoneMath.point.distance(movedPoint, data.handles.start) > cornerstoneMath.point.distance(movedPoint, data.handles.end)) {
data.handles.perpendicularEnd.x = adjustedLineP2.x - distanceFromMoved * dy;
data.handles.perpendicularEnd.y = adjustedLineP2.y + distanceFromMoved * dx;
@@ -558,7 +558,7 @@
perpendicularLine.end = {x: eventData.currentPoints.image.x, y: eventData.currentPoints.image.y};
intersection = cornerstoneMath.lineSegment.intersectLine(longLine, perpendicularLine);
if (!intersection.intersected) {
if (!intersection) {
perpendicularLine.end = {x: data.handles.perpendicularStart.x, y: data.handles.perpendicularStart.y};
intersection = cornerstoneMath.lineSegment.intersectLine(longLine, perpendicularLine);
@@ -566,7 +566,7 @@
d1 = cornerstoneMath.point.distance(intersection, data.handles.start);
d2 = cornerstoneMath.point.distance(intersection, data.handles.end);
if (!intersection.intersected || d1 < 3 || d2 < 3) {
if (!intersection || d1 < 3 || d2 < 3) {
outOfBounds = true;
}
}
@@ -593,7 +593,7 @@
perpendicularLine.end = {x: eventData.currentPoints.image.x, y: eventData.currentPoints.image.y};
intersection = cornerstoneMath.lineSegment.intersectLine(longLine, perpendicularLine);
if (!intersection.intersected) {
if (!intersection) {
perpendicularLine.end = {x: data.handles.perpendicularEnd.x, y: data.handles.perpendicularEnd.y};
intersection = cornerstoneMath.lineSegment.intersectLine(longLine, perpendicularLine);
@@ -601,7 +601,7 @@
d1 = cornerstoneMath.point.distance(intersection, data.handles.start);
d2 = cornerstoneMath.point.distance(intersection, data.handles.end);
if (!intersection.intersected || d1 < 3 || d2 < 3) {
if (!intersection || d1 < 3 || d2 < 3) {
outOfBounds = true;
}
}
@@ -8,7 +8,7 @@
var i = 0;
while (config.verticalLine.start.y + i * config.verticalMinorTick <= config.vscaleBounds.bottom) {
while (config.verticalLine.start.y + i * config.verticalMinorTick <= config.vscaleBounds.bottomRight.y) {
var startPoint = {
x: config.verticalLine.start.x,
@@ -39,7 +39,7 @@
i = 0;
while (config.horizontalLine.start.x + i * config.horizontalMinorTick <= config.hscaleBounds.right) {
while (config.horizontalLine.start.x + i * config.horizontalMinorTick <= config.hscaleBounds.bottomRight.x) {
startPoint = {
x: config.horizontalLine.start.x + i * config.horizontalMinorTick,
@@ -207,22 +207,22 @@
majorTickLength: 25,
verticalLine: {
start: {
x: vscaleBounds.right ,
y: vscaleBounds.top
x: vscaleBounds.bottomRight.x,
y: vscaleBounds.topLeft.y
},
end: {
x: vscaleBounds.right,
y: vscaleBounds.bottom
x: vscaleBounds.bottomRight.x,
y: vscaleBounds.bottomRight.y
}
},
horizontalLine: {
start: {
x: hscaleBounds.left,
y: hscaleBounds.bottom
x: hscaleBounds.topLeft.x,
y: hscaleBounds.bottomRight.y
},
end: {
x: hscaleBounds.right,
y: hscaleBounds.bottom
x: hscaleBounds.bottomRight.x,
y: hscaleBounds.bottomRight.y
}
},
color: cornerstoneTools.toolColors.getToolColor(),