chessboardjs icon indicating copy to clipboard operation
chessboardjs copied to clipboard

board.resize only works when width changes

Open aditya1709 opened this issue 7 years ago • 2 comments

board.resize only works when width changes, but when the height of the browser window changes the chess board is not resized. Is there a way to achieve this?

aditya1709 avatar Apr 02 '19 02:04 aditya1709

maybe you can call board.resize() manually when windows's size changed

arcsinw avatar Apr 23 '19 01:04 arcsinw

it does resize on every window resize - but its calculations are based solely on width. You have to make it check for height in calculateSquareSize()

So where it says: var containerWidth = parseInt(elWidth, 10); You have to do something like

  var containerHeight = parseInt(elHeight, 10);
containerWidth = Math.min(containerWidth,containerHeight);

dax006 avatar May 10 '19 03:05 dax006