From f0363c5757174d1c1cd72c92983bb55922bce161 Mon Sep 17 00:00:00 2001 From: Geoffrey Allott Date: Fri, 16 Jun 2023 18:27:36 +0100 Subject: [PATCH] fix some visual glitches --- site/modules/cribbage.js | 2 +- site/modules/whist.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/site/modules/cribbage.js b/site/modules/cribbage.js index f21ba6c..1f14fe9 100644 --- a/site/modules/cribbage.js +++ b/site/modules/cribbage.js @@ -105,7 +105,7 @@ export class Cribbage extends GameWithChat { const sep = username === this.username ? 60 : 20; const offset = (cards.length - 3/2) * sep / 2; let x = 227.5 + offset - 180 * Math.sin(angle); - const y = username === this.username ? 450 : 210 + 120 * Math.cos(angle); + const y = username === this.username ? 500 : 210 + 120 * Math.cos(angle); const width = username === this.username ? 90 : 45; const height = username === this.username ? 140 : 70; for (const {card, image} of cards) { diff --git a/site/modules/whist.js b/site/modules/whist.js index f324b71..1f5944d 100644 --- a/site/modules/whist.js +++ b/site/modules/whist.js @@ -90,7 +90,7 @@ export class KnockOutWhist extends GameWithChat { const sep = username === this.username ? 60 : 20; const offset = (cards.length - 3/2) * sep / 2; let x = 227.5 + offset - 180 * Math.sin(angle); - const y = username === this.username ? 450 : 210 + 120 * Math.cos(angle); + const y = username === this.username ? 500 : 210 + 120 * Math.cos(angle); const width = username === this.username ? 90 : 45; const height = username === this.username ? 140 : 70; for (const {card, image} of cards) { @@ -108,6 +108,8 @@ export class KnockOutWhist extends GameWithChat { image.classList.remove("my-card"); image.setAttribute("x", x); image.setAttribute("y", y); + image.setAttribute("width", 45); + image.setAttribute("height", 70); x -= 20; } x = 120.0; -- 2.34.1