Due to rounding the hitdetection may have been off by one pixel. At map edge the pixel coordinate may exceed the map's dimensions if an decimal pixel ratio is used, this is fixed by clamping to the canvas dimensions.
=