containsPoint

Returns true if the shape contains the specified point.

Parameters

point kendo.geometry.Point

The point that should be checked.

Returns

Boolean value indicating if the shape contains the point.

Example

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

    var rectGeometry = new geom.Rect([50, 50], [100, 100]);
    var rect = new draw.Rect(rectGeometry).fill("green");

    // Check if points are inside the rectangle
    var point1 = new geom.Point(75, 75); // Inside
    var point2 = new geom.Point(25, 25); // Outside

    console.log("Point 1 inside:", rect.containsPoint(point1)); // true
    console.log("Point 2 inside:", rect.containsPoint(point2)); // false

    var surface = draw.Surface.create($("#surface"));
    surface.draw(rect);
</script>
In this article
containsPoint
Not finding the help you need?
Contact Support