@botmock/editor
Advanced tools
Comparing version 0.1.26 to 0.1.27
@@ -184,9 +184,11 @@ import "../../styling/connector.less"; | ||
if (segmentStartPoints.length === 3) { | ||
// Closest point is the first midpoint, or the second segment end point | ||
let closestPoint = pointsAreEqual(endPoint, firstMidPoint) ? segmentEndPoints[0] : firstMidPoint; | ||
if ( | ||
(this.props.fromSurface === "left" || | ||
this.props.fromSurface === "right") && | ||
((startPoint[1] < segmentEndPoints[0][1] && | ||
segmentEndPoints[0][1] < segmentStartPoints[2][1]) || | ||
(segmentStartPoints[2][1] < segmentEndPoints[0][1] && | ||
segmentEndPoints[0][1] < startPoint[1])) | ||
(getDirectionY(startPoint, segmentStartPoints[2]) === -1 ? | ||
(closestPoint[1] > segmentStartPoints[2][1]) : | ||
(closestPoint[1] < segmentStartPoints[2][1]) | ||
) | ||
) { | ||
@@ -201,6 +203,6 @@ startPointShifted[0] += | ||
this.props.fromSurface === "bottom") && | ||
((startPoint[0] < segmentEndPoints[0][0] && | ||
segmentEndPoints[0][0] < segmentStartPoints[2][0]) || | ||
(segmentStartPoints[2][0] < segmentEndPoints[0][0] && | ||
segmentEndPoints[0][0] < startPoint[0])) | ||
(getDirectionX(startPoint, segmentStartPoints[2]) === -1 ? | ||
(closestPoint[0] > segmentStartPoints[2][0]) : | ||
(closestPoint[0] < segmentStartPoints[2][0]) | ||
) | ||
) { | ||
@@ -215,13 +217,10 @@ startPointShifted[1] += | ||
if (segmentEndPoints.length === 3) { | ||
let closestPoint = pointsAreEqual(startPoint, lastMidPoint) ? segmentStartPoints[segmentStartPoints.length - 1] : lastMidPoint; | ||
if ( | ||
(this.props.toSurface === "left" || | ||
this.props.toSurface === "right") && | ||
((endPoint[1] < | ||
segmentStartPoints[segmentStartPoints.length - 1][1] && | ||
segmentStartPoints[segmentStartPoints.length - 1][1] < | ||
segmentEndPoints[0][1]) || | ||
(segmentEndPoints[0][1] < | ||
segmentStartPoints[segmentStartPoints.length - 1][1] && | ||
segmentStartPoints[segmentStartPoints.length - 1][1] < | ||
endPoint[1])) | ||
(getDirectionY(endPoint, segmentEndPoints[0]) === 1 ? | ||
(segmentEndPoints[0][1] > closestPoint[1]) : | ||
(segmentEndPoints[0][1] < closestPoint[1]) | ||
) | ||
) { | ||
@@ -236,10 +235,6 @@ endPointShifted[0] += | ||
this.props.toSurface === "bottom") && | ||
((endPoint[0] < | ||
segmentStartPoints[segmentStartPoints.length - 1][0] && | ||
segmentStartPoints[segmentStartPoints.length - 1][0] < | ||
segmentEndPoints[0][0]) || | ||
(segmentEndPoints[0][0] < | ||
segmentStartPoints[segmentStartPoints.length - 1][0] && | ||
segmentStartPoints[segmentStartPoints.length - 1][0] < | ||
endPoint[0])) | ||
(getDirectionX(endPoint, segmentEndPoints[0]) === 1 ? | ||
(segmentEndPoints[0][0] > closestPoint[0]) : | ||
(segmentEndPoints[0][0] < closestPoint[0]) | ||
) | ||
) { | ||
@@ -479,2 +474,17 @@ endPointShifted[1] += | ||
// for (let i = 0; i < this.state.segmentPoints.length; i++) { | ||
// midPoints.push( | ||
// <circle | ||
// cx={this.state.segmentPoints[i][0]} | ||
// cy={this.state.segmentPoints[i][1]} | ||
// key={"sp" + i} | ||
// r="5" | ||
// data-index={i} | ||
// className={classNames({ | ||
// "connector-midpoint": true | ||
// })} | ||
// ></circle> | ||
// ); | ||
// } | ||
let label; | ||
@@ -481,0 +491,0 @@ if (this.props.label && this.props.label.text && this.props.to) { |
{ | ||
"name": "@botmock/editor", | ||
"version": "0.1.26", | ||
"version": "0.1.27", | ||
"description": "Botmock Editor", | ||
@@ -5,0 +5,0 @@ "main": "output/editor.esm.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
404273
10088