Fix canvas resize animation

Currently when we resize, by selecting the size in the dropdown, the editor goes into a infinite loop.

**Expected behavior:**
Resize the canvas gradually, with a nice animation. 

**Repro:**
1. Choose a different size.
2. Check that the animation is performed correctly.

**Browsers:**
Verified in Chrome 29.0.1547.65, Firefox 23.0.1