fix some visual glitches
authorGeoffrey Allott <geoffrey@allott.email>
Fri, 16 Jun 2023 17:27:36 +0000 (18:27 +0100)
committerGeoffrey Allott <geoffrey@allott.email>
Fri, 16 Jun 2023 17:27:36 +0000 (18:27 +0100)
site/modules/cribbage.js
site/modules/whist.js

index f21ba6c985136b353e2c4efff0f0844955b6f0f6..1f14fe92139f5ec0c208f86da576fcf82764232e 100644 (file)
@@ -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) {
index f324b7156693b41b91a4519d590ff613e805615a..1f5944d4767dd00360f88e26b4993ceba972b05b 100644 (file)
@@ -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;