callback when drawing, handle selected element first in onmousedown