return (
                    (y1 >= t && y1 <= b) ||    // Top edge touching
                    (y2 >= t && y2 <= b) ||    // Bottom edge touching
                    (y1 < t && y2 > b)        // Surrounded vertically
                ) && (