From 43333e401a22fc19a7cf0c87c180b37989a7b1a5 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Thu, 18 Aug 2022 02:35:46 -0400 Subject: Fix small formatting bug --- scripts/cards/deck.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'scripts/cards') diff --git a/scripts/cards/deck.js b/scripts/cards/deck.js index 3ed94ff..f42c896 100644 --- a/scripts/cards/deck.js +++ b/scripts/cards/deck.js @@ -63,16 +63,7 @@ class Deck { } updatePos() - { - let cb = this.e.getBoundingClientRect(); - - if(cb.width >= window.innerWidth) - this.e.className = "maxw"; - else if (cb.height >= window.innerHeight) - this.e.className = "maxh"; - else - this.e.className = ""; - + { let len = this.cards.length - 1; for(let i in this.cards) this.cards[i].setPos(len-i); @@ -176,6 +167,15 @@ class Deck { updateCount () { this.e.style.setProperty("--ccount", this.cards.length - 1); + + let cb = this.e.getBoundingClientRect(); + + if(cb.width >= window.innerWidth) + this.e.className = "maxw"; + else if (cb.height >= window.innerHeight) + this.e.className = "maxh"; + else + this.e.className = ""; } isInside(x, y) -- cgit v1.2.3