clip

Gets or sets the element clipping path.

Example - setting clipping path on an element

<div id="surface"></div>
<script>
    var draw = kendo.drawing;
    var geom = kendo.geometry;

    var circle = new draw.Circle(new geom.Circle([100, 100], 80), {
        stroke: { color: "red", width: 1 }
    });

    var clipPath = new draw.Path();
    clipPath.moveTo(0, 0).lineTo(100, 100).lineTo(100, 0).close();

    circle.clip(clipPath);

    var surface = draw.Surface.create($("#surface"));
    surface.draw(circle);
</script>

Example - clear clipping path

<div id="surface"></div>
<script>
    var draw = kendo.drawing;
    var geom = kendo.geometry;

    var clipPath = new draw.Path();
    clipPath.moveTo(0, 0).lineTo(100, 100).lineTo(100, 0).close();

    var circle = new draw.Circle(new geom.Circle([80, 80], 60), {
      clip: clipPath,
      stroke: { color: "red", width: 1 }
    });

    var surface = draw.Surface.create($("#surface"));
    surface.draw(circle);

    setTimeout(function() {
            circle.clip(null);
    }, 2000);
</script>

Parameters

clip kendo.drawing.PathThe element clipping path.

Returnskendo.drawing.Path The current element clipping path.

In this article
Not finding the help you need? Improve this article