check if the viewport size actually changed on resize. fixes #271