repeat node initial support
This commit is contained in:
1 parent
f392cf17fd
commit
de2307901b
13 files changed
+301
-77
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { DAGDims, DAGEntities, Size } from "./types";
|
||||
import { DAGDims, DAGEntities } from "./types";
|
||||
import { XYPosition } from "react-flow-renderer";
|
||||
|
||||
export const moveAlong = (
|
||||
@@ -22,26 +22,6 @@ export const moveAlong = (
|
||||
return !dims.flipped ? moveOnX : moveOnY;
|
||||
};
|
||||
|
||||
export const moveAlongOnce = (
|
||||
by: keyof DAGEntities,
|
||||
startPoint: XYPosition,
|
||||
dims: DAGDims,
|
||||
reversed: boolean = false
|
||||
): XYPosition => {
|
||||
const moveOnY = {
|
||||
y: startPoint.y + dims[by].height * (dims.distanceFactor.node - 1),
|
||||
x: startPoint.x,
|
||||
};
|
||||
const moveOnX = {
|
||||
x: startPoint.x + dims[by].width * (dims.distanceFactor.node - 1),
|
||||
y: startPoint.y,
|
||||
};
|
||||
if (reversed) {
|
||||
return dims.flipped ? moveOnX : moveOnY;
|
||||
}
|
||||
return !dims.flipped ? moveOnX : moveOnY;
|
||||
};
|
||||
|
||||
export const moveAlongRelativeTo = (
|
||||
offsetPos: XYPosition,
|
||||
relatedPos: XYPosition,
|
||||
|
||||
Reference in new issue
Block a user