fixed a bug where the view used for rendering a layer was not correctly reset