properly handling mouseleave events for resize tool