<commit_before>define(function(require, exports, module) {

    var inherits = require('../utils/inherits');
    var One = require('./One');
    var MouseEvent = require('./events/MouseEvent');
    var Point = require('../geom/Point')

    var Engine = function(options) {
        this._stage = null;
        this._canvas = null;
        this._debug = true;
    }

    var p = Engine.prototype;

    /**
     * @param  {core.Stage} stage
     */
    p.init = function(stage, canvas) {
        this._stage = stage;
        this._canvas = canvas;
        var offsetLeft = canvas.offsetLeft;
        var offsetTop = canvas.offsetTop;

        /**
         * Currently, the size of stage concerts the size window.
         */
        var _onResize = function() {
            canvas.width = stage.width = window.innerWidth - (offsetLeft * 2 + 5);
            canvas.height = stage.height = window.innerHeight - (offsetLeft * 2 + 5);
        };

        window.addEventListener('resize', _onResize);
        _onResize();


        var _lastTarget;

        /**
         * Mouse Event is transfered with capsulation.
         * See {core.events.MouseEvent} for details.
         */
        var _onMouse = function(e) {
            var global = new Point(e.pageX - offsetLeft, e.pageY - offsetTop);
            var target = stage.hit(global);
            if (!target)
                return;
            /**
             * Dispatch event "mouseout"
             * The code below is ambiguous, explicit logic is expected.
             */
            if (_lastTarget && _lastTarget !== target) {
                var local = _lastTarget.globalToLocal(global);
                _lastTarget && _lastTarget.dispatchEvent(new MouseEvent({
                    type: "mouseout",
                    global: global,
                    local: local
                }));
            }
            _lastTarget = target;

            var local = target.globalToLocal(global);
            target.dispatchEvent(new MouseEvent({
                type: e.type,
                global: global,
                local: local
            }));
        };<commit_msg>add MouseEvent.mouseaway<commit_after>define(function(require, exports, module) {

    var inherits = require('../utils/inherits');
    var One = require('./One');
    var MouseEvent = require('./events/MouseEvent');
    var Point = require('../geom/Point')

    var Engine = function(options) {
        this._stage = null;
        this._canvas = null;
        this._debug = true;
    }

    var p = Engine.prototype;

    /**
     * @param  {core.Stage} stage
     */
    p.init = function(stage, canvas) {
        this._stage = stage;
        this._canvas = canvas;
        var offsetLeft = canvas.offsetLeft;
        var offsetTop = canvas.offsetTop;

        /**
         * Currently, the size of stage concerts the size window.
         */
        var _onResize = function() {
            canvas.width = stage.width = window.innerWidth - (offsetLeft * 2 + 5);
            canvas.height = stage.height = window.innerHeight - (offsetLeft * 2 + 5);
        };

        window.addEventListener('resize', _onResize);
        _onResize();


        var _lastTarget;

        /**
         * Mouse Event is transfered with capsulation.
         * See {core.events.MouseEvent} for details.
         */
        var _onMouse = function(e) {
            var global = new Point(e.pageX - offsetLeft, e.pageY - offsetTop);
            var target = stage.hit(global);
            if (!target)
                return;
            /**
             * Dispatch event "mouseout"
             * The code below is ambiguous, explicit logic is expected.
             */
            if (_lastTarget && _lastTarget !== target) {
                var local = _lastTarget.globalToLocal(global);
                _lastTarget && _lastTarget.dispatchEvent(new MouseEvent({
                    type: "mouseaway",
                    global: global,
                    local: local
                }));
            }
            _lastTarget = target;

            var local = target.globalToLocal(global);
            target.dispatchEvent(new MouseEvent({
                type: e.type,
                global: global,
                local: local
            }));
        };
{'fraction_non_alphanumeric': 0.11098130841121495, 'fraction_numerical': 0.001869158878504673, 'mean_word_length': 1.540652818991098, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1956200', 'n_tokens_mistral': 1128, 'n_tokens_neox': 1085, 'n_words': 279}