correction of a bug concerning the disappearance of the obstacles when resizing the window