|
@@ -188,8 +188,8 @@ export const getAdsorbSelfLinesPosition = ({
|
|
angle,
|
|
angle,
|
|
}: AdsorbSelfLinesProps) => {
|
|
}: AdsorbSelfLinesProps) => {
|
|
if (!points?.length) return;
|
|
if (!points?.length) return;
|
|
- // 当前位置始终在第一个点
|
|
|
|
|
|
|
|
|
|
+ // 当前位置始终在第一个点
|
|
const last = points.slice(0, 2).flatMap((a) => a);
|
|
const last = points.slice(0, 2).flatMap((a) => a);
|
|
const first = points
|
|
const first = points
|
|
.slice(points.length - 2, points.length)
|
|
.slice(points.length - 2, points.length)
|
|
@@ -200,14 +200,20 @@ export const getAdsorbSelfLinesPosition = ({
|
|
createLineByDire(getVerticaLineDire(first), [first[2], first[3]], 10),
|
|
createLineByDire(getVerticaLineDire(first), [first[2], first[3]], 10),
|
|
];
|
|
];
|
|
|
|
|
|
- // 垂直最后一段
|
|
|
|
- return (
|
|
|
|
- getAdsorbLinePositionRaw({
|
|
|
|
|
|
+ // 垂直前后
|
|
|
|
+ let aposition;
|
|
|
|
+ if (
|
|
|
|
+ (aposition = getAdsorbLinePositionRaw({
|
|
position,
|
|
position,
|
|
refLines: vlines,
|
|
refLines: vlines,
|
|
angle,
|
|
angle,
|
|
- }) || position
|
|
|
|
- );
|
|
|
|
|
|
+ }))
|
|
|
|
+ ) {
|
|
|
|
+ return aposition;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 垂直自身连接
|
|
|
|
+ // position
|
|
};
|
|
};
|
|
|
|
|
|
export type AdsorbProps = Omit<
|
|
export type AdsorbProps = Omit<
|