feat: create flowcharts from a generic element using elbow arrows (#8329)

Co-authored-by: Mark Tolmacs <mark@lazycat.hu>
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
Ryan Di
2024-08-09 03:43:15 +08:00
committed by GitHub
parent dd1370381d
commit 54491d13d4
21 changed files with 1431 additions and 19 deletions

View File

@@ -44,7 +44,7 @@ import {
getHoveredElementForBinding,
isBindingEnabled,
} from "./binding";
import { tupleToCoors } from "../utils";
import { toBrandedType, tupleToCoors } from "../utils";
import {
isBindingElement,
isElbowArrow,
@@ -1447,9 +1447,17 @@ export class LinearElementEditor {
: null;
}
console.warn("movePoints", options?.changedElements);
const mergedElementsMap = options?.changedElements
? toBrandedType<SceneElementsMap>(
new Map([...elementsMap, ...options.changedElements]),
)
: elementsMap;
mutateElbowArrow(
element,
elementsMap,
mergedElementsMap,
nextPoints,
[offsetX, offsetY],
bindings,