Issue #154 fix

Here is a fix for the animation problem after window resize.
Sorry for the indentation changes, sublime text did it.