clamping transformed coordinates to integers in 2D immediate mode