bbox

Returns the bounding box of the element with transformations applied. Inherited from Element.bbox

Example - getting the bounding box

<div id="surface" style="width: 250px; height: 250px;"></div>
<script>
    var draw = kendo.drawing;

    var multiPath = new draw.MultiPath()
        .moveTo(50, 50).lineTo(150, 50).lineTo(100, 100).close()
        .moveTo(100, 150).lineTo(200, 150).lineTo(150, 200).close();

    var bbox = multiPath.bbox();
    console.log("Bounding box: " + bbox.toString());

    // Draw the bounding box for visualization
    var bboxRect = new draw.Rect(new kendo.geometry.Rect(bbox.origin, bbox.size), {
        stroke: { color: "red", width: 1, dashType: "dash" },
        fill: null
    });

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

Returns

kendo.geometry.Rect The bounding box of the element with transformations applied.

In this article
bbox
Not finding the help you need?
Contact Support