const dy = Math.max(Math.abs(py - cy) - (rect.bottom - rect.top) / 2, 0);