# Code coverage report for src/layer/vector/canvas/Circle.Canvas.js

## Statements: 16.67% (1 / 6) Branches: 25% (1 / 4) Functions: 0% (0 / 2) Lines: 16.67% (1 / 6)

All files » src/layer/vector/canvas/ » Circle.Canvas.js

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19

    1

     /*
     * Extends L.Circle with Canvas-specific code.
     */

    L.Circle.include(!L.Path.CANVAS ? {} : {
    	_drawPath: function () {
    		var p = this._point;
    		this._ctx.beginPath();
    		this._ctx.arc(p.x, p.y, this._radius, 0, Math.PI * 2, false);
    	},

    	_containsPoint: function (p) {
    		var center = this._point,
    		    w2 = this.options.stroke ? this.options.weight / 2 : 0;

    		return (p.distanceTo(center) <= this._radius + w2);
    	}
    });