Fixed that buttons in PauseLayer can be pressed when the layer is not visible.