Align linked-to placards

This commit is contained in:
Tony Garnock-Jones 2022-01-26 22:38:42 +01:00
parent 5990d13e07
commit 5cbee822d2
1 changed files with 10 additions and 5 deletions

View File

@ -82,10 +82,10 @@ function bootRenderer(ds: Ref) {
loop(n - 1);
}
} else {
setTimeout(() => f.turn(() => loop(1)), 100);
r.container.scrollLeft =
(r.playground.width.baseVal.value - r.container.getBoundingClientRect().width)
/ 2;
setTimeout(() => f.turn(() => loop(1)), 50);
// r.container.scrollLeft =
// (r.playground.width.baseVal.value - r.container.getBoundingClientRect().width)
// / 2;
}
}
loop(0);
@ -301,7 +301,7 @@ class Renderer {
try {
return f();
} finally {
this.ypos = saved;
this.ypos = Math.max(saved, this.ypos);
}
}
@ -443,6 +443,11 @@ class Renderer {
const arrowheadSpace = new P.Point(
(15 - 3.75) * (other.midX > swimlane.midX ? -1 : 1),
0);
if (e.bounds.height < f.bounds.height) {
e.updateBounds(b => b.withMidY(f.bounds.midY));
} else {
f.updateBounds(b => b.withMidY(e.bounds.midY));
}
const ps = other.midX > swimlane.midX
? e.bounds.midRight.sub(arrowheadSpace)
: e.bounds.midLeft.sub(arrowheadSpace);