Call this.resetRenderState() only once if dimension changed

@jpallen, can you do another small review here please?

Motivation for the change: If the viewport size changes, the `this.resetRenderState();` should be called only once.

PS: @jpallen is that okay if I ask you for review on these PR? I don't want you to feel comitted to do the reviews and force you in doing anything but your help here is highly appreciated :)