compositor: fix snapping for surfaces with top or left margins