src/video/canvas/canvas_renderer.js
function (poly, fill) {
            var context = this.backBufferContext2D;

            if (context.globalAlpha < 1 / 255) {
                // Fast path: don't draw fully transparent
                return;
            }

            this.translate(poly.pos.x, poly.pos.y);
            context.beginPath();
            context.moveTo(poly.points[0].x, poly.points[0].y);
            var point;
            for (var i = 1; i < poly.points.length; i++) {
                point = poly.points[i];
                context.lineTo(point.x, point.y);
            }
            context.lineTo(poly.points[0].x, poly.points[0].y);
            context[fill === true ? "fill" : "stroke"]();
            context.closePath();
            this.translate(-poly.pos.x, -poly.pos.y);
        }
function (poly, fill) {
            var context = this.backBufferContext2D;

            if (context.globalAlpha < 1 / 255) {
                // Fast path: don't draw fully transparent
                return;
            }

            this.translate(poly.pos.x, poly.pos.y);
            context.beginPath();
            context.moveTo(poly.points[0].x, poly.points[0].y);
            var point;
            for (var i = 1; i < poly.points.length; i++) {
                point = poly.points[i];
                context.lineTo(point.x, point.y);
            }
            context.lineTo(poly.points[0].x, poly.points[0].y);
            context[fill === true ? "fill" : "stroke"]();
            context.closePath();
            this.translate(-poly.pos.x, -poly.pos.y);
        }
function ( poly , fill ) { var context = this . backBufferContext2D ; if ( context . globalAlpha < 1 / 255 ) { // Fast path: don't draw fully transparent return ; } this . translate ( poly . pos . x , poly . pos . y ) ; context . beginPath ( ) ; context . moveTo ( poly . points [ 0 ] . x , poly . points [ 0 ] . y ) ; var point ; for ( var i = 1 ; i < poly . points . length ; i ++ ) { point = poly . points [ i ] ; context . lineTo ( point . x , point . y ) ; } context . lineTo ( poly . points [ 0 ] . x , poly . points [ 0 ] . y ) ; context [ fill === true ? "fill" : "stroke" ] ( ) ; context . closePath ( ) ; this . translate ( - poly . pos . x , - poly . pos . y ) ; }
Stroke the given me.Polygon on the screen
@name strokePolygon
@memberOf me.CanvasRenderer.prototype
@function
@param {me.Polygon} poly the shape to draw
Stroke the given me . Polygon on the screen