working trigger editor

This commit is contained in:
ari committed 2021-12-21 22:46:16 -05:00
1 parent 3cfb8151eb
commit 24f7c3c3af
14 files changed
+250 -66

No files matched your search

@@ -5,38 +5,14 @@ import { makeUpdater, Updater } from './updater';
import { ChooseAction } from 'types/automations/actions';
import { AutomationCondition } from "types/automations/conditions";
import { ModalState } from "./types";
import { offsetPoint, makeOffsetMaintainer} from "utils/graph";
export type UpdateModalState = (
s: ModalState
) => void;
const offsetPoint = (
[x, y]: Point,
[ox, oy]: Point = [0, 0],
): Point => [x + ox, y + oy];
const makeOffsetMaintainer = (startPoint: Point) => {
let offset: Point = [0, 0];
let i = 0;
return {
setI(newI: number) {
i = newI;
},
resetY() {
offset[1] = 0;
},
update(p: Point, innerStartLoc: Point) {
offset[0] = Math.max(offset[0], p[0] - i - 0.5 - startPoint[0])
offset[1] = Math.max(offset[1], p[1] - innerStartLoc[1] + 1)
},
get x() {
return offset[0]
},
get y() {
return offset[1]
}
}
}
function* dealWithNested(
nodeLoc: Point,