If the view is zoomed in or out from its default size at all, the bug manifests as tiles which are offset by a few pixels in one direction. At small sizes (including the default view in portrait on my iPhone 6S) the error can be a significant proportion of the tile, so it gets confusing to see what's going on. The offset is always in the tile's vertical direction, but tiles can be displayed with 90 degree rotation, so the displacement on screen can be in any direction. (Also you may notice that tiles change displacement when the map scrolls even if the zoom stays the same - but only if the whole interface is being zoomed smaller for being drawn on small screens).
A tile looks something like this (I've simplified it a bit):
Code: Select all
<div id="tile_35" class="bdtile" style="top: 127.54473388671876px; left: -127.54473388671876px; width: 127.54469794418385px; height: 127.54469794418385px;">
<div id="tile_art_35" class="tile_art" style="background-size: 382.63409383255157px 10458.665231423076px; background-position: 0% -2200%;">
</div>
</div>NB: I'm not saying Safari isn't wrong to be doing this truncation, but even if someone gets them to fix it, then it will still only look right for BGA users who have updated to the latest and greatest Safari version, and it may be possible to work around it in Carcassonne's code without breaking things for other browsers.
I believe that adding the line:
Code: Select all
this.tile_size = (Math.round(this.tile_size * this.gameinterface_zoomFactor)) / this.gameinterface_zoomFactor;
just after tile_size is written (in onWheel(), onUnzoom(), and the constructor) will probably have the right effect.
This arranges that the javascript does its calculations based on a tile size which will end up being a whole number of pixels on the screen, so the precise number and the truncated number agree.