on hit rectangular functionality