This commit is contained in:
Sebastian Seedorf
2022-08-18 09:20:00 +02:00
parent 92b762bbd2
commit de95f57b18
60 changed files with 3450 additions and 994 deletions

View File

@@ -1,14 +1,14 @@
export function createPath(container: DOMRect, start: DOMRect, end: DOMRect) {
const startX = Math.round(start.x + start.width/2 - container.x)
const startX = Math.round(start.x + start.width / 2 - container.x)
const startY = Math.round(start.bottom - container.y)
const endX = Math.round(end.x + end.width/2 - container.x)
const endX = Math.round(end.x + end.width / 2 - container.x)
const endY = Math.round(end.top - container.y)
const mid = Math.round((start.bottom + end.top) / 2 - container.y)
return `M${startX},${startY} C${startX},${mid} ${endX},${mid} ${endX},${endY}`
}
export function drawLine(container: DOMRect, elem: DOMRect) {
const x = Math.round(elem.x + elem.width/2 - container.x)
const x = Math.round(elem.x + elem.width / 2 - container.x)
const top = Math.round(elem.top - container.y)
const bottom = Math.round(elem.bottom - container.y)
return `M${x},${top} L${x},${bottom}`