[Minor] Remove unneeded whitespace
[Fix] Replaced conidtion with a more accurate (and simpler) one

This also works correctly in the case where the CU extends beyond the
the viewport from both the top and bottom