<commit_before>(function (out) {
    
    out.canvas = out.canvas || {};
    
    /**
     * 
     *   [Constructor] MO5.canvas.Rectangle:
     *   ===================================
     *   
     *      Wraps the rectangle functionality of the HTML5 Canvas.
     *  
     *  
     *      Concepts:
     *      ---------
     *  
     * Dimensions
     * Position
     * Layer
     * Rotation
     * Border
     * Shadow
     * Transparency
     * Canvas Object
     * 
     *  
     *      Parameters:
     *      -----------
     *  
     *         1. canvas:
     *            [MO5.canvas.Canvas] The Canvas object to use.
     *  
     *         2. args:
     *            [Object] An object literal for initializing optional arguments.
     *            Take a look at the concepts section for all possible properties.
     *       
     *            Properties:
     *  
     * color: 
     *                  [String] The fill color of the rectangle. 
     *                  Default: "#fff".
     *  
     *  
     */
    out.canvas.Rectangle = function (canvas, args)
    {
        args = args || {};
        
        out.canvas.CanvasObject.call(this, canvas, args);

        if (!(this instanceof out.canvas.Rectangle))
        {
            return new out.canvas.Rectangle(canvas, args);
        }

        this.color = args.color || "#fff";
        this.borderColor = args.borderColor || "#000";
        this.borderWidth = args.borderWidth || 0;
        this.shadowX = args.shadowX || 5;
        this.shadowY = args.shadowY || 5;
        this.shadowBlur = args.shadowBlur || 5;
        this.shadowColor = args.shadowColor || "rgba(0, 0, 0, 0.5)";
        this.hasShadow = args.hasShadow || false;
    };
    
    out.canvas.Rectangle.prototype = new out.canvas.CanvasObject();

    out.canvas.Rectangle.prototype.draw = function ()
    {
        var self = this,
            ct = self.canvas.ct,
            x = self.x,
            y = self.y,
            width = self.width,
            height = self.height,
            rotation = self.rotation,
            pivotX = self.pivotX,
            pivotY = self.pivotY;
        
        ct.save();
        ct.globalAlpha = self.alpha;
        
        if (rotation > 0)
        {
            ct.translate(pivotX, pivotY);
            ct.rotate((Math.PI * rotation) / 180);
            ct.translate(-pivotX, - pivotY);
        }
        
        if (self.hasShadow === true)
        {
            ct.shadowOffsetX = self.shadowX;
            ct.shadowOffsetY = self.shadowY;
            ct.shadowBlur = self.shadowBlur;
            ct.shadowColor = self.shadowColor;<commit_msg>Changed MO5.canvas.Rectangle to use the new drawing mechanism.<commit_after>(function (out) {
    
    out.canvas = out.canvas || {};
    
    /**
     * 
     *   [Constructor] MO5.canvas.Rectangle:
     *   ===================================
     *   
     *      Wraps the rectangle functionality of the HTML5 Canvas.
     *  
     *  
     *      Concepts:
     *      ---------
     *  
     * Dimensions
     * Position
     * Layer
     * Rotation
     * Border
     * Shadow
     * Transparency
     * Canvas Object
     * 
     *  
     *      Parameters:
     *      -----------
     *  
     *         1. canvas:
     *            [MO5.canvas.Canvas] The Canvas object to use.
     *  
     *         2. args:
     *            [Object] An object literal for initializing optional arguments.
     *            Take a look at the concepts section for all possible properties.
     *       
     *            Properties:
     *  
     * color: 
     *                  [String] The fill color of the rectangle. 
     *                  Default: "#fff".
     *  
     *  
     */
    out.canvas.Rectangle = function (canvas, args)
    {
        args = args || {};
        
        out.canvas.CanvasObject.call(this, canvas, args);

        if (!(this instanceof out.canvas.Rectangle))
        {
            return new out.canvas.Rectangle(canvas, args);
        }

        this.color = args.color || "#fff";
        this.borderColor = args.borderColor || "#000";
        this.borderWidth = args.borderWidth || 1;
        this.shadowX = args.shadowX || 5;
        this.shadowY = args.shadowY || 5;
        this.shadowBlur = args.shadowBlur || 5;
        this.shadowColor = args.shadowColor || "rgba(0, 0, 0, 0.5)";
        this.hasShadow = args.hasShadow || false;
        this.width = 100;
        this.height = 60;
    };
    
    out.canvas.Rectangle.prototype = new out.canvas.CanvasObject();

    out.canvas.Rectangle.prototype.draw = function (env)
    {
        var self = this,
            ct = env.context,
            x = self.x,
            y = self.y,
            width = self.width,
            height = self.height,
            rotation = self.rotation,
            pivotX = self.pivotX,
            pivotY = self.pivotY;
        
        ct.save();
        ct.globalAlpha = self.alpha;
        
        if (rotation > 0)
        {
            ct.translate(pivotX, pivotY);
            ct.rotate((Math.PI * rotation) / 180);
            ct.translate(-pivotX, - pivotY);
        }
        
        if (self.hasShadow === true)
        {
            ct.shadowOffsetX = self.shadowX;
            ct.shadowOffsetY = self.shadowY;
            ct.shadowBlur = self.shadowBlur;
            ct.shadowColor = self.shadowColor;
{'fraction_non_alphanumeric': 0.12944020829458805, 'fraction_numerical': 0.008926910916868142, 'mean_word_length': 1.3201035375323555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2853519', 'n_tokens_mistral': 1625, 'n_tokens_neox': 1542, 'n_words': 325}