End a polygon appropriately
169963
function endPolygon(coordCurr, normPrev, normNext, join_type, v, context) {
    // If polygon ends on a tile boundary, don't add a join
    if (isCoordOutsideTile(coordCurr)) {
        addVertex(coordCurr, normPrev, normPrev, 1, v, context, 1);
        addVertex(coordCurr, normPrev, normPrev, 0, v, context, -1);
        indexPairs(1, context);
    }
    else {
        // If polygon ends within a tile, add Miter or no joint (join added on startPolygon)
        var miterVec = createMiterVec(normPrev, normNext);

        if (join_type === JOIN_TYPE.miter && Vector.lengthSq(miterVec) > context.miter_len_sq) {
            join_type = JOIN_TYPE.bevel; // switch to bevel
        }

        if (join_type === JOIN_TYPE.miter) {
            addVertex(coordCurr, miterVec, normPrev, 1, v, context, 1);
            addVertex(coordCurr, miterVec, normPrev, 0, v, context, -1);
            indexPairs(1, context);
        }
        else {
            addVertex(coordCurr, normPrev, normPrev, 1, v, context, 1);
            addVertex(coordCurr, normPrev, normPrev, 0, v, context, -1);
            indexPairs(1, context);
        }
    }
}
790240
def draw_polygon(
            self,
            *pts,
            close_path=True,
            stroke=None,
            stroke_width=1,
            stroke_dash=None,
            fill=None
            ) -> None:
        """"""
        c = self.c
        c.saveState()

        if stroke is not None:
            c.setStrokeColorRGB(*stroke)
            c.setLineWidth(stroke_width)
            c.setDash(stroke_dash)
        if fill is not None:
            c.setFillColorRGB(*fill)

        p = c.beginPath()
        fn = p.moveTo
        for x,y in zip(*[iter(pts)]*2):
            fn(x, y)
            fn = p.lineTo
        if close_path:
            p.close()

        c.drawPath(p, stroke=(stroke is not None), fill=(fill is not None))
        c.restoreState()
153736
public void end () {
    Texture tex = (Texture)tile();
    Image image = canvas.image;
    // if our texture is already the right size, just update it
    if (tex != null && tex.pixelWidth == image.pixelWidth() &&
        tex.pixelHeight == image.pixelHeight()) tex.update(image);
    // otherwise we need to create a new texture (setTexture will unreference the old texture which
    // will cause it to be destroyed)
    else super.setTile(canvas.image.createTexture(Texture.Config.DEFAULT));
  }
36929
def ends(self, s):
        """"""
        length = len(s)
        if s[length - 1] != self.b[self.k]:  # tiny speed-up
            return 0
        if length > (self.k - self.k0 + 1):
            return 0
        if self.b[self.k - length + 1 : self.k + 1] != s:
            return 0
        self.j = self.k - length
        return 1
51795
def end_output (self, **kwargs):
        """"""
        self.xml_endtag(u"urlset")
        self.xml_end_output()
        self.close_fileoutput()
1017632
function end()
    {
        $data = ob_get_contents();
        ob_end_clean();
        $this->save($data, $this->_id, $this->_group);
        echo($data);
    }
575904
function endTraversal() {
        var pane = _getPane(ACTIVE_PANE);

        if (_traversingFileList) {
            _traversingFileList = false;

            _makeFileMostRecent(pane.id, pane.getCurrentlyViewedFile());
        }
    }
949535
function endsWithAny(string, vector) {
  return _.any(vector.map(function (e) { return _str.endsWith(string, e); }));
}
1181095
function polygonCanSee2(polygon, a,b) {
    // for each edge
    for (var i = 0; i !== polygon.length; ++i) {
        // ignore incident edges
        if (i === a || i === b || (i + 1) % polygon.length === a || (i + 1) % polygon.length === b){
            continue;
        }
        if( lineSegmentsIntersect(polygonAt(polygon, a), polygonAt(polygon, b), polygonAt(polygon, i), polygonAt(polygon, i+1)) ){
            return false;
        }
    }
    return true;
}
716950
public function endSlot()
    {
        last($this->componentStack);

        $currentSlot = array_pop(
            $this->slotStack[$this->currentComponent()]
        );

        $this->slots[$this->currentComponent()]
                    [$currentSlot] = new HtmlString(trim(ob_get_clean()));
    }
936262
function polygonMakeCCW(polygon){
    var br = 0,
        v = polygon;

    // find bottom right point
    for (var i = 1; i < polygon.length; ++i) {
        if (v[i][1] < v[br][1] || (v[i][1] === v[br][1] && v[i][0] > v[br][0])) {
            br = i;
        }
    }

    // reverse poly if clockwise
    if (!isLeft(polygonAt(polygon, br - 1), polygonAt(polygon, br), polygonAt(polygon, br + 1))) {
        polygonReverse(polygon);
        return true;
    } else {
        return false;
    }
}
735231
def end_block(self):
        """"""
        self.current_indent -= 1

        # If we did not add a new line automatically yet, now it's the time!
        if not self.auto_added_line:
            self.writeln()
            self.auto_added_line = True
1348913
function(tree, alsoRemovecoplanarFront) {
            var node = this, stack = [];
            do {
                if(node.polygontreenodes.length > 0) {
                    tree.rootnode.clipPolygons(node.polygontreenodes, alsoRemovecoplanarFront);
                }
                if(node.front) stack.push(node.front);
                if(node.back) stack.push(node.back);
                node = stack.pop();
            } while(typeof(node) !== 'undefined');
        }
716764
def end(self):
        """"""
        with self.__lock:
            if self.__write:
                self.__write(compress_end(self.__ctx))
            else:
                return compress_end(self.__ctx)
223807
public void endClipped () {
    batch.flush(); // flush our clipped calls with SCISSOR_TEST still enabled
    Rectangle r = popScissorState();
    if (r == null) batch.gl.glDisable(GL20.GL_SCISSOR_TEST);
    else batch.gl.glScissor(r.x, r.y, r.width, r.height);
    batch.gl.checkError("endClipped");
  }
1117501
def cleanPolygon(elem, options):
    
    global _num_points_removed_from_polygon

    pts = parseListOfPoints(elem.getAttribute('points'))
    N = len(pts) / 2
    if N >= 2:
        (startx, starty) = pts[:2]
        (endx, endy) = pts[-2:]
        if startx == endx and starty == endy:
            del pts[-2:]
            _num_points_removed_from_polygon += 1
    elem.setAttribute('points', scourCoordinates(pts, options, True))
1021294
function(force) {
        OpenLayers.Handler.Path.prototype.destroyFeature.call(
            this, force);
        this.polygon = null;
    }