fix(player): align edge projections with avatar drag

This commit is contained in:
2026-09-10 01:02:43 +03:00
parent 1396bad76d
commit 5a806fb5b8
5 changed files with 48 additions and 4 deletions
+9
View File
@@ -95,6 +95,13 @@ test("player map cells enlarge small projections without exceeding a readable bo
assert.ok(fourByFour <= 72);
});
test("authoritative self cell remains below the centered avatar at map edges", () => {
assert.deepEqual(player.playerMapOffset(0, 7, 0, 0, 7, 7, 46), {x: 138, y: 138});
assert.deepEqual(player.playerMapOffset(48, 7, 0, 0, 7, 7, 46), {x: -138, y: -138});
assert.deepEqual(player.playerMapOffset(24, 7, 1, 1, 5, 5, 46), {x: 0, y: 0});
assert.deepEqual(player.playerMapOffset(-1, 7, 0, 0, 7, 7, 46), {x: 0, y: 0});
});
test("onboarding has bounded, replayable steps", () => {
assert.equal(player.ONBOARDING_STEPS.length, 8);
assert.equal(player.nextOnboardingStep(0), 1);
@@ -111,6 +118,8 @@ test("avatar control resets safely and retains accessible alternatives", () => {
assert.match(script, /addEventListener\("blur", resetAvatarControl\)/);
assert.match(script, /connectionState !== "online"\) resetAvatarControl\(\)/);
assert.match(script, /snapshot\.phase === "paused"\) \{ resetAvatarControl\(\)/);
assert.match(script, /state\.avatar\.startX = event\.clientX/);
assert.match(script, /event\.clientX - state\.avatar\.startX/);
assert.match(script, /setMuted\(!state\.muted\)/);
assert.match(script, /setReducedMotion\(!state\.reducedMotion\)/);
assert.match(html, /id="avatar-control"/);