Closed dhirallin closed 1 year ago
The reason is that straight horizontal and vertical lines get blurry if they land in between pixels, for many setups.
My bad, this was to do with how our app was rendering the board, not a bug in chessground. Sorry for the inconvenience.
I'm still confused by this, could you help?
If I use the example linked here: https://github.com/lichess-org/chessground-examples/blob/master/index.standalone.html
When cg-container is resized by updateBounds() to align with integer pixel bounderies, cg-wrap and the parent div of cg-wrap are not also being resized. Because of this, the image of the board is staying the same size as before, and the pieces become mis-aligned.
What is the correct solution to this? I can duplicate the code from updateBounds() to resize the parent of cg-wrap. But this seems pretty clunky.
The board image should be on cg-board. The example might be a bit outdated. I recommend comparing to Lichess's setup since that's what chessgrounds is written for.
Ok great, now I've got it, thanks again for your help.
The updateBounds function was truncating the fractional part of the board's width and height. There is no reason to do this. Fractional pixel widths/heights are a legit thing.