Better token layout

This commit is contained in:
marcin.sciesinski
2017-06-12 04:06:22 -07:00
parent 6ab3f5c91e
commit 96d808b7d5

View File

@@ -416,10 +416,13 @@ function layoutTokens(cardElem) {
if (tokenInColumnIndex == tokenInColumnMax) {
tokenInColumnIndex = 0;
tokenIndex++;
tokenX = (tokenIndex * (width / (tokenColumns + 1))) - (tokenSize / 2)
tokenX = (tokenIndex * (width / (tokenColumns + 1))) - (tokenSize / 2);
}
var tokenY = Math.floor((maxDimension / 13) * (1 + tokenInColumnIndex));
if (i%2 == 1)
tokenX += Math.floor(tokenSize / 5);
var tokenElem = $("<img class='token' src='images/tokens/" + token.toLowerCase() + ".png' width='" + tokenSize + "' height='" + tokenSize + "'></img>").css({position:"absolute", left:tokenX + "px", top:tokenY + "px"});
tokenOverlay.append(tokenElem);
tokenInColumnIndex++;