Pasting a layer makes it go where it was copied from. If the viewport isn't looking at that location, and the pasted object(s) would be fully outside the view, we want to transform it/them (i.e. its/their bounding box) to the center of the viewport, by an integer number of pixels offset.
PRs with useful diffs to reference: #2212, #2177