<commit_before>iD.behavior.Draw = function(context) {
    var event = d3.dispatch('move', 'click', 'clickWay',
        'clickNode', 'undo', 'cancel', 'finish'),
        keybinding = d3.keybinding('draw'),
        hover = iD.behavior.Hover(),
        closeTolerance = 4,
        tolerance = 12;

    function datum() {
        if (d3.event.altKey) return {};
        else return d3.event.target.__data__ || {};
    }

    function mousedown() {

        function point() {
            var p = target.node().parentNode;
            return touchId !== null ? d3.touches(p).filter(function(p) {
                return p.identifier === touchId;
            })[0] : d3.mouse(p);
        }

        var target = d3.select(this),
            touchId = d3.event.touches ? d3.event.changedTouches[0].identifier : null,
            time = +new Date(),
            pos = point();

        target.on('mousemove.draw', null);

        d3.select(window).on('mouseup.draw', function() {
            target.on('mousemove.draw', mousemove);
            if (iD.geo.dist(pos, point()) < closeTolerance ||
                (iD.geo.dist(pos, point()) < tolerance &&
                (+new Date() - time) < 500)) {
                click();
            }
            if (target.node() === d3.event.target) {
                d3.select(window).on('click.draw', function() {
                    d3.select(window).on('click.draw', null);
                    d3.event.stopPropagation();
                });
            }<commit_msg>Usecapture when blocking click<commit_after>iD.behavior.Draw = function(context) {
    var event = d3.dispatch('move', 'click', 'clickWay',
        'clickNode', 'undo', 'cancel', 'finish'),
        keybinding = d3.keybinding('draw'),
        hover = iD.behavior.Hover(),
        closeTolerance = 4,
        tolerance = 12;

    function datum() {
        if (d3.event.altKey) return {};
        else return d3.event.target.__data__ || {};
    }

    function mousedown() {

        function point() {
            var p = target.node().parentNode;
            return touchId !== null ? d3.touches(p).filter(function(p) {
                return p.identifier === touchId;
            })[0] : d3.mouse(p);
        }

        var target = d3.select(this),
            touchId = d3.event.touches ? d3.event.changedTouches[0].identifier : null,
            time = +new Date(),
            pos = point();

        target.on('mousemove.draw', null);

        d3.select(window).on('mouseup.draw', function() {
            target.on('mousemove.draw', mousemove);
            if (iD.geo.dist(pos, point()) < closeTolerance ||
                (iD.geo.dist(pos, point()) < tolerance &&
                (+new Date() - time) < 500)) {
                click();
            }
            if (target.node() === d3.event.target) {
                d3.select(window).on('click.draw', function() {
                    d3.select(window).on('click.draw', null);
                    d3.event.stopPropagation();
                }, true);
            }
{'fraction_non_alphanumeric': 0.1596694214876033, 'fraction_numerical': 0.014545454545454545, 'mean_word_length': 1.7236723672367236, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '733061', 'n_tokens_mistral': 932, 'n_tokens_neox': 885, 'n_words': 166}