<commit_before>/**
 * 虚线lineTo 
 *
 * author:  Kener (@Kener-林峰, <EMAIL>)
 *          errorrik (<EMAIL>)
 */

define(
    function (/* require */) {
        /**
         * 虚线lineTo 
         */
        return function (ctx, x1, y1, x2, y2, dashLength) {
            dashLength = typeof dashLength != 'number'
                            ? 5 
                            : dashLength;

            var deltaX = x2 - x1;
            var deltaY = y2 - y1;
            var numDashes = Math.floor(
                Math.sqrt(deltaX * deltaX + deltaY * deltaY) / dashLength
            );

            for (var i = 0; i < numDashes; ++i) {
                ctx[i % 2 ? 'lineTo' : 'moveTo'](
                    x1 + (deltaX / numDashes) * i,
                    y1 + (deltaY / numDashes) * i
                );
            }
        };
    }
);<commit_msg>dashedLine补最后一段<commit_after>/**
 * 虚线lineTo 
 *
 * author:  Kener (@Kener-林峰, <EMAIL>)
 *          errorrik (<EMAIL>)
 */

define(
    function (/* require */) {
        /**
         * 虚线lineTo 
         */
        return function (ctx, x1, y1, x2, y2, dashLength) {
            dashLength = typeof dashLength != 'number'
                            ? 5 
                            : dashLength;

            var deltaX = x2 - x1;
            var deltaY = y2 - y1;
            var numDashes = Math.floor(
                Math.sqrt(deltaX * deltaX + deltaY * deltaY) / dashLength
            );

            for (var i = 0; i < numDashes; ++i) {
                ctx[i % 2 ? 'lineTo' : 'moveTo'](
                    x1 + (deltaX / numDashes) * i,
                    y1 + (deltaY / numDashes) * i
                );
            }
            ctx.lineTo(x2, y2);
        };
    }
);
{'fraction_non_alphanumeric': 0.13005780346820808, 'fraction_numerical': 0.016184971098265895, 'mean_word_length': 1.0412735849056605, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5262232', 'n_tokens_mistral': 573, 'n_tokens_neox': 559, 'n_words': 124}