Skip to content

Commit

Permalink
fix: elbow connector
Browse files Browse the repository at this point in the history
  • Loading branch information
doouding committed Nov 28, 2024
1 parent d094cbe commit c5a8d0f
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ export class MindMapIndicatorOverlay extends Overlay {
}

private _generatePath() {
const startRelativePoint =
const startRelativePos =
this.direction === LayoutType.RIGHT
? PointLocation.fromVec([1, 0.5])
: PointLocation.fromVec([0, 0.5]);
const endRelativePoint =
const endRelativePos =
this.direction === LayoutType.RIGHT
? PointLocation.fromVec([0, 0.5])
: PointLocation.fromVec([1, 0.5]);
Expand All @@ -76,20 +76,20 @@ export class MindMapIndicatorOverlay extends Overlay {
if (this.mode === ConnectorMode.Orthogonal) {
return this.pathGen
.generateOrthogonalConnectorPath({
startPoint: startRelativePoint,
endPoint: endRelativePoint,
startPoint: this._getRelativePoint(parentBound!, startRelativePos),
endPoint: this._getRelativePoint(newPosBound!, endRelativePos),
startBound: parentBound,
endBound: newPosBound,
})
.map(p => new PointLocation(p));
} else if (this.mode === ConnectorMode.Curve) {
const startPoint = this._getRelativePoint(
this.parentBound!,
startRelativePoint
startRelativePos
);
const endPoint = this._getRelativePoint(
this.targetBound!,
endRelativePoint
endRelativePos
);

const startTangentVertical = Vec.rot(startPoint.tangent, -Math.PI / 2);
Expand All @@ -116,10 +116,10 @@ export class MindMapIndicatorOverlay extends Overlay {
return [startPoint, endPoint];
} else {
const startPoint = new PointLocation(
this.parentBound!.getRelativePoint(startRelativePoint)
this.parentBound!.getRelativePoint(startRelativePos)
);
const endPoint = new PointLocation(
this.targetBound!.getRelativePoint(endRelativePoint)
this.targetBound!.getRelativePoint(endRelativePos)
);

return [startPoint, endPoint];
Expand Down

0 comments on commit c5a8d0f

Please sign in to comment.