Place new Full cast members independently when the connected view is empty

This commit is contained in:
Nick Beckley 2026-11-27 00:21:28 +00:00
parent 7c705dd258
commit dc65c9b258
2 changed files with 27 additions and 2 deletions

View File

@ -192,6 +192,25 @@ const { chromium } = require("playwright"),
);
await p.locator("#rwEmptyFull").click();
await ready();
assert(
await p.evaluate(() => {
const nodes = PlotDirectorRelationshipWorkspace.cy.nodes(":visible"),
bs = nodes.map((n) => n.boundingBox({ includeOverlays: false }));
return (
nodes.length === 20 &&
bs.every((a, i) =>
bs
.slice(i + 1)
.every(
(b) =>
Math.min(a.x2, b.x2) <= Math.max(a.x1, b.x1) ||
Math.min(a.y2, b.y2) <= Math.max(a.y1, b.y1),
),
)
);
}),
"Full cast from an empty view places each new member separately before any automatic arrangement",
);
await p.locator('.rw-menu[data-pwa-context="Layout"] > summary').click();
await p.locator("#rwLayout").selectOption("radial");
await p.locator("#rwCentreDialog[open]").waitFor();

View File

@ -323,8 +323,14 @@
}
function freePosition(id, preferred) {
const c = castById.get(id),
other = visible()
.filter((n) => n.data("characterID") !== id)
other = cy
.nodes()
.filter(
(n) =>
n.data("characterID") !== id &&
members.has(n.data("characterID")) &&
positions.has(n.data("characterID")),
)
.map((n) => ({
id: n.data("characterID"),
w: n.outerWidth(),