Energy2D: Make resize more efficient

Do not check every fram if size has changed.