Fix #1160, and clear the canvas correctly.

The canvas used to be cleared by "resize" which would write
to the size even if it was unchanged.  Now that this is no
longer the case, it must be cleared manually.
Merge pull request #1172 from AnalyticalGraphicsInc/issue1160

Fix #1160, and clear the canvas correctly.