Skip to content

Commit e40fdb1

Browse files
committed
Fix Y at the vertical center of each cell
1 parent 8d14e3a commit e40fdb1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

playing-cards-2-planes/Table.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ export class Table extends Container {
184184
const cellIndex = freeCells[0];
185185
const qb = this._getQuadrantBounds(cellIndex);
186186

187-
// Random position within the cell
187+
// Random X within the cell, Y fixed at cell center
188188
const x = qb.minX + Math.random() * (qb.maxX - qb.minX);
189-
const y = qb.minY + Math.random() * (qb.maxY - qb.minY);
189+
const y = (qb.minY + qb.maxY) / 2;
190190

191191
// Random rotation in range [-20, 20] degrees
192192
const angle = Math.random() * 40 - 20;

0 commit comments

Comments
 (0)