condition + repeat node
This commit is contained in:
1 parent
89c7007612
commit
07ab4b9089
22 files changed
+631
-282
No files matched your search
@@ -26,19 +26,15 @@ export const moveAlongRelativeTo = (
|
||||
offsetPos: XYPosition,
|
||||
relatedPos: XYPosition,
|
||||
dims: DAGDims,
|
||||
incrementBy: keyof DAGEntities = "condition"
|
||||
incrementBy: keyof DAGEntities = "collection"
|
||||
) =>
|
||||
dims.flipped
|
||||
? {
|
||||
x:
|
||||
relatedPos.x +
|
||||
(dims.distanceFactor.node - 1) * dims[incrementBy].width,
|
||||
x: relatedPos.x + dims.distanceFactor.node * dims[incrementBy].width,
|
||||
y: offsetPos.y,
|
||||
}
|
||||
: {
|
||||
y:
|
||||
relatedPos.y +
|
||||
(dims.distanceFactor.node - 1) * dims[incrementBy].height,
|
||||
y: relatedPos.y + dims.distanceFactor.node * dims[incrementBy].height,
|
||||
x: offsetPos.x,
|
||||
};
|
||||
|
||||
@@ -60,3 +56,12 @@ export const moveFromTo = (
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
export const offsetBy = (
|
||||
by: keyof DAGEntities,
|
||||
position: XYPosition,
|
||||
dims: DAGDims
|
||||
): XYPosition => ({
|
||||
x: position.x + dims.distanceFactor[by] * dims[by].width,
|
||||
y: position.y + dims.distanceFactor[by] * dims[by].height,
|
||||
});
|
||||
Reference in new issue
Block a user