As you know using rounded coordinates while drawing on canvas is faster. Also floating coordinates may cause unintended gaps on canvas. For example, you are drawing google map tiles to canvas, 256x256 tiles work well, if the starting coordinates are integer. If not, to avoid one pixel unpainted lines, you should round the coordinates.
Here, that's Ok.
But, what if you should use scaling, transformation over canvas, how can you round the coordinates?
e.g.
ctx.drawImage(image, round(x), round(y), 256, 256);
is OK.
But what if
ctx.scale(1.0/65536);
ctx.translate(118079.4);
ctx.drawImage(image, x, y, 256, 256); // where x and y are integers like 118413
The image will be drawn into floating coordinates. How can I round that coordinates?