Fix a bug where selecting a sprite with the mouse would not work properly.