Correctly handle the tiling.cycle wraparound for both negative and positive directions