Revert "fix the bug on resizing the viewport"

This reverts commit 9c04cecce5fecafee846eb90084cbb0efd0b5ba7.
fix the bug on resizing the viewport