Revert "Revert "Solved clipping problem""

This reverts commit 185b3f423c06765e55522463bb5888736349b885.