Function drawLineOnMask