mock: 選択中のクラスターにだけ原点の丸を出す(T-30 単位5)

単位1の選択の描画層に、選択中のクラスターとバリアントグループの原点の丸を描く。
長押しの候補になっているだけのクラスターには出さない。丸の大きさは画面上で固定する。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NznQtmVPoQAnietqwr1auL
This commit is contained in:
2026-10-22 09:42:32 +09:00
co-authored by Claude Opus 5.5
parent e50722948d
commit 812e2edfc2
5 changed files with 43 additions and 0 deletions
+17
View File
@@ -115,6 +115,23 @@ test("ドラッグ中に右端で自動スクロールし、Undo 1回で戻る",
await expect(key).toHaveAttribute("transform", before!);
});
test("選択中のクラスターにだけ原点の丸を出す", async ({ page }) => {
const keys = page.locator('[data-node-type="key"]');
const corner = (await keys.nth(0).locator(".key-face").boundingBox())!;
const cluster = await makeCluster(page);
const clusterId = await cluster.getAttribute("data-node-id");
await keys.nth(5).click();
await expect(page.locator(".origin")).toHaveCount(0);
await page.locator(`[data-tree-id="${clusterId}"]`).first().click();
const origin = page.locator(`[data-origin-id="${clusterId}"]`);
await expect(origin).toHaveCount(1);
const box = (await origin.boundingBox())!;
expect(Math.abs(box.x + box.width / 2 - corner.x)).toBeLessThan(2);
expect(Math.abs(box.y + box.height / 2 - corner.y)).toBeLessThan(2);
await keys.nth(5).click();
await expect(page.locator(".origin")).toHaveCount(0);
});
test("クラスター化で画面位置を保つ", async ({ page }) => {
const keys = page.locator('[data-node-type="key"]');
const centers = async () =>