Established logic to setup boundaries shown in comments inside
MouseEvent methods.