Fixed mouse events after resizing the window