|
@@ -75,7 +75,7 @@ export const getAdsorbLinePosition = ({
|
|
position,
|
|
position,
|
|
refLineName = "adsord-line",
|
|
refLineName = "adsord-line",
|
|
exclusionIds = [],
|
|
exclusionIds = [],
|
|
- angle = 3,
|
|
|
|
|
|
+ angle = 2,
|
|
radiusInner = 500,
|
|
radiusInner = 500,
|
|
}: AdsorbLineProps) => {
|
|
}: AdsorbLineProps) => {
|
|
const refLines = tree.stage
|
|
const refLines = tree.stage
|
|
@@ -209,15 +209,18 @@ export const getAdsorbSelfLinesPosition = ({
|
|
export type AdsorbProps = Omit<
|
|
export type AdsorbProps = Omit<
|
|
AdsorbPointProps & AdsorbLineProps & AdsorbSelfLinesProps,
|
|
AdsorbPointProps & AdsorbLineProps & AdsorbSelfLinesProps,
|
|
"position"
|
|
"position"
|
|
-> & { pixel?: number[]; position?: number[]; radiusInner?: number };
|
|
|
|
|
|
+> & {
|
|
|
|
+ pixel?: number[];
|
|
|
|
+ position?: number[];
|
|
|
|
+ radiusInner?: number;
|
|
|
|
+ pointsArray?: number[][][];
|
|
|
|
+};
|
|
|
|
|
|
export const getAdsorbPosition = (props: AdsorbProps) => {
|
|
export const getAdsorbPosition = (props: AdsorbProps) => {
|
|
const position = props.position || props.tree.getRealFromStage(props.pixel);
|
|
const position = props.position || props.tree.getRealFromStage(props.pixel);
|
|
let refPosition: number[];
|
|
let refPosition: number[];
|
|
if ((refPosition = getAdsorbPointPosition({ ...props, position }))) {
|
|
if ((refPosition = getAdsorbPointPosition({ ...props, position }))) {
|
|
return refPosition;
|
|
return refPosition;
|
|
- } else if ((refPosition = getAdsorbLinePosition({ ...props, position }))) {
|
|
|
|
- return refPosition;
|
|
|
|
} else if ((refPosition = getAdsorbCrossPosition({ ...props, position }))) {
|
|
} else if ((refPosition = getAdsorbCrossPosition({ ...props, position }))) {
|
|
return refPosition;
|
|
return refPosition;
|
|
} else if (
|
|
} else if (
|
|
@@ -225,5 +228,23 @@ export const getAdsorbPosition = (props: AdsorbProps) => {
|
|
) {
|
|
) {
|
|
return refPosition;
|
|
return refPosition;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (props.pointsArray) {
|
|
|
|
+ for (let i = 0; i < props.pointsArray.length; i++) {
|
|
|
|
+ if (
|
|
|
|
+ (refPosition = getAdsorbSelfLinesPosition({
|
|
|
|
+ ...props,
|
|
|
|
+ position,
|
|
|
|
+ points: props.pointsArray[i],
|
|
|
|
+ }))
|
|
|
|
+ ) {
|
|
|
|
+ return refPosition;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ((refPosition = getAdsorbLinePosition({ ...props, position }))) {
|
|
|
|
+ return refPosition;
|
|
|
|
+ }
|
|
return position;
|
|
return position;
|
|
};
|
|
};
|